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 | 5bb5391fd3ad9874fdb266dd5b6d57f084626d13 (patch) | |
tree | 7da3eb718fe1d524660bb17fe5231794f14ade5f | |
parent | e633b4b961165c1a2b9d9e926bfccd9f62c645e7 (diff) | |
download | txr-5bb5391fd3ad9874fdb266dd5b6d57f084626d13.tar.gz txr-5bb5391fd3ad9874fdb266dd5b6d57f084626d13.tar.bz2 txr-5bb5391fd3ad9874fdb266dd5b6d57f084626d13.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; } |