Sha256: a11f3e104a1e41ccae98c64efcd7adc39feed9d6b11736b24b8d6b650f04e0f3

Contents?: true

Size: 1.38 KB

Versions: 1

Compression:

Stored size: 1.38 KB

Contents

#include <stdlib.h>
#include "ext_scanners.h"

bufsize_t _ext_scan_at(bufsize_t (*scanner)(const unsigned char *), unsigned char *ptr, int len, bufsize_t offset)
{
	bufsize_t res;

        if (ptr == NULL || offset > len) {
          return 0;
        } else {
	  unsigned char lim = ptr[len];

	  ptr[len] = '\0';
	  res = scanner(ptr + offset);
	  ptr[len] = lim;
        }

	return res;
}

/*!re2c
  re2c:define:YYCTYPE  = "unsigned char";
  re2c:define:YYCURSOR = p;
  re2c:define:YYMARKER = marker;
  re2c:define:YYCTXMARKER = marker;
  re2c:yyfill:enable = 0;

  spacechar = [ \t\v\f];
  newline = [\r]?[\n];

  escaped_char = [\\][|!"#$%&'()*+,./:;<=>?@[\\\]^_`{}~-];

  table_marker = [|](spacechar*[-]+spacechar*);
  table_cell = [|](escaped_char|[^|\r\n])+;
*/

bufsize_t _scan_table_cell(const unsigned char *p)
{
  const unsigned char *marker = NULL;
  const unsigned char *start = p;
/*!re2c
  table_cell { return (bufsize_t)(p - start); }
  .? { return 0; }
*/
}

bufsize_t _scan_table_row_end(const unsigned char *p)
{
  const unsigned char *marker = NULL;
  const unsigned char *start = p;
/*!re2c
  [|]newline { return (bufsize_t)(p - start); }
  .? { return 0; }
*/
}

bufsize_t _scan_table_start(const unsigned char *p)
{
  const unsigned char *marker = NULL;
  const unsigned char *start = p;
/*!re2c
  (table_marker)+ [|]newline { return (bufsize_t)(p - start); }
  .? { return 0; }
*/
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
commonmarker-0.11.0 ext/commonmarker/cmark/extensions/ext_scanners.re