From 2caa6f458ba33815f18658fd309a994ebd04279b Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 15 Feb 2022 14:03:02 -0800 Subject: [PATCH] end -> sentinel --- src/lex.re_c.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lex.re_c.c b/src/lex.re_c.c index cc34f5a..24aff9a 100644 --- a/src/lex.re_c.c +++ b/src/lex.re_c.c @@ -133,15 +133,15 @@ int lex_next(struct lex *const x) { x->s0 = x->s1 = 0; scan: /*!re2c - end = "\x00"; + sentinel = "\x00"; illegal = [\x01-\x08\x0a-\x1f\x7f]; // unix-style control characters newline = "\n"; ws = [ \t]; glyph = [^\x00-\x1f \x7f]; <*> illegal { return x->symbol = ILLEGAL, 0; } - end { return x->symbol = END, 0; } + sentinel { return x->symbol = END, 0; } - end { return x->symbol = ILLEGAL, 0; } + sentinel { return x->symbol = ILLEGAL, 0; } newline { x->line = ++scan.line; return x->symbol = PARAGRAPH, 1; } "![" :=> image "[" :=> edict @@ -162,10 +162,11 @@ scan: } * { printf("image(broken)\n");return 0; } + // natural = [1-9][0-9]*; id = [a-zA-Z_][a-zA-Z_\-0-9]{0,63}; date = "-"? natural "-" [0-1][0-9] "-" [0-1][0-9]; - // source + "source" { if(scan.is_ws_expected || scan.edict.size) return x->symbol = SYNTAX, 0;