Added ->[keyword](geo:dec,dec) for saving and keyword can now start with a number, as long as it has an alpha.
This commit is contained in:
parent
6524d06c2b
commit
bd53cf2ccc
@ -14,7 +14,7 @@ int lex_looks_like_day(const char *);
|
|||||||
\
|
\
|
||||||
/* Edicts. */ \
|
/* Edicts. */ \
|
||||||
X(SOURCE), X(DEFAULT), X(SOURCE_RECALL), \
|
X(SOURCE), X(DEFAULT), X(SOURCE_RECALL), \
|
||||||
X(LOCATION), X(LOCATION_RECALL), \
|
X(LOCATION), X(LOCATION_SAVE), X(LOCATION_RECALL), \
|
||||||
X(SIGNIFICANT), X(SIGNIFICANT_RECALL), \
|
X(SIGNIFICANT), X(SIGNIFICANT_RECALL), \
|
||||||
\
|
\
|
||||||
/* Arguments. */ \
|
/* Arguments. */ \
|
||||||
|
@ -134,7 +134,7 @@ int lex_next(struct lex *const x) {
|
|||||||
newline = "\n";
|
newline = "\n";
|
||||||
ws = [ \t];
|
ws = [ \t];
|
||||||
glyph = [^] \ (sentinel | illegal | newline | ws);
|
glyph = [^] \ (sentinel | illegal | newline | ws);
|
||||||
keyword = [a-zA-Z_][a-zA-Z0-9_\-]{0,63};
|
keyword = ([a-zA-Z] | [0-9][0-9_\-]*[a-zA-Z]) [a-zA-Z0-9_\-]*;
|
||||||
decimal = "-"? ([1-9][0-9]* | [0])? "." [0-9]+ | [1-9][0-9]* | [0];
|
decimal = "-"? ([1-9][0-9]* | [0])? "." [0-9]+ | [1-9][0-9]* | [0];
|
||||||
natural = [1-9][0-9]*;
|
natural = [1-9][0-9]*;
|
||||||
date = "-"? natural "-" [0-1][0-9] "-" [0-1][0-9];
|
date = "-"? natural "-" [0-1][0-9] "-" [0-1][0-9];
|
||||||
@ -170,6 +170,8 @@ scan:
|
|||||||
{ x->s0 = s0, x->s1 = s1; return x->symbol = SOURCE_RECALL, 1; }
|
{ x->s0 = s0, x->s1 = s1; return x->symbol = SOURCE_RECALL, 1; }
|
||||||
|
|
||||||
<location> "" / "(" :=> map
|
<location> "" / "(" :=> map
|
||||||
|
<location> "[" ws* @s0 keyword @s1 ws* "]"
|
||||||
|
{ x->s0 = s0, x->s1 = s1; return x->symbol = LOCATION_SAVE, 1; }
|
||||||
<location> @s0 keyword @s1 => expect_line
|
<location> @s0 keyword @s1 => expect_line
|
||||||
{ x->s0 = s0, x->s1 = s1; return x->symbol = LOCATION_RECALL, 1; }
|
{ x->s0 = s0, x->s1 = s1; return x->symbol = LOCATION_RECALL, 1; }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user