diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-05-11 06:22:32 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-05-11 06:22:32 -0700 |
commit | cd79ce1098f433b5451f9550c659c502c2df8d18 (patch) | |
tree | 7da3eb718fe1d524660bb17fe5231794f14ade5f | |
parent | a5b59aabe9e194b1519d8595fe82d1746a9a005e (diff) | |
download | txr-cd79ce1098f433b5451f9550c659c502c2df8d18.tar.gz txr-cd79ce1098f433b5451f9550c659c502c2df8d18.tar.bz2 txr-cd79ce1098f433b5451f9550c659c502c2df8d18.zip |
lexer: eliminate regex alias used in one place.
* parser.l (SYM, TOK): These are just aliases for the same
pattern. SYM is referenced only in one place; TOK in multiple
places, so let's remove SYM and replace that one reference
by TOK.
-rw-r--r-- | parser.l | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -190,7 +190,7 @@ static wchar_t num_esc(scanner_t *scn, char *num) %option stack noinput reentrant bison-bridge extra-type="parser_t *" -SYM [a-zA-Z0-9_]+ +TOK [a-zA-Z0-9_]+ SGN [+\-] EXP [eE][+\-]?[0-9]+ DIG [0-9] @@ -206,7 +206,6 @@ BSCHR [a-zA-Z0-9!$%&*+\-<=>?\\_~] NSCHR [a-zA-Z0-9!$%&*+\-<=>?\\_~/] ID_END [^a-zA-Z0-9!$%&*+\-<=>?\\_~/] EXTRA [#^] -TOK {SYM} BT0 {BSCHR}({BSCHR}|{EXTRA})* BT1 @{BT0}+ BT2 ({BSCHR}|{EXTRA})+ @@ -960,7 +959,7 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U} return LITCHAR; } -<CHRLIT>{SYM} { +<CHRLIT>{TOK} { yylval->lexeme = utf8_dup_from(yytext); return SYMTOK; } |