From 5bb5391fd3ad9874fdb266dd5b6d57f084626d13 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 11 May 2018 06:22:32 -0700 Subject: 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. --- parser.l | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/parser.l b/parser.l index 6c68b280..5fd70a51 100644 --- a/parser.l +++ b/parser.l @@ -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; } -{SYM} { +{TOK} { yylval->lexeme = utf8_dup_from(yytext); return SYMTOK; } -- cgit v1.2.3