Move definition of 'tPATH' token up, so that '/', '.' and '0xA' (etc)
authorC. Scott Ananian <cscott@cscott.net>
Mon, 14 Mar 2005 10:48:08 +0000 (10:48 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 14 Mar 2005 10:48:08 +0000 (10:48 +0000)
are lexed as paths (in the appropriate contexts) instead of as
operator or number tokens.
Add '-' to the set of characters legal in a pathname.

programs/winedbg/debug.l

index afb8bb111e1577832860201ac4b631ae83002455..e8387e41209a818f92faa04a1d3d74846c90f7cf 100644 (file)
@@ -74,7 +74,7 @@ DIGIT    [0-9]
 HEXDIGIT   [0-9a-fA-F]
 FORMAT     [ubcdgiswx]
 IDENTIFIER [_a-zA-Z~][_a-zA-Z0-9~@]*
-PATHNAME   [/_a-zA-Z\.~][/_a-zA-Z0-9\.~@]*
+PATHNAME   [-/_a-zA-Z\.~][-/_a-zA-Z0-9\.~@]*
 STRING     \"[^\n"]+\"
 
 %s FORMAT_EXPECTED
@@ -98,6 +98,11 @@ STRING     \"[^\n"]+\"
 <*>\n                                  { BEGIN(INITIAL); syntax_error = 0; return tEOL; }
                                         /* Indicates end of command. Reset state. */
 
+                                        /* This rule must precede the ones below, */
+                                        /* otherwise paths like '/' or '0x9' would */
+                                        /* get parsed as an operator or tNUM */
+<PATH_EXPECTED>{PATHNAME}              { yylval.string = lexeme_alloc(yytext); return tPATH; }
+
 "||"                                   { return OP_LOR; }
 "&&"                                   { return OP_LAND; }
 "=="                                   { return OP_EQ; }
@@ -205,8 +210,6 @@ all                                     { return tALL; }
 {IDENTIFIER}                           { yylval.string = lexeme_alloc(yytext); return tIDENTIFIER; }
 "$"{IDENTIFIER}                                { yylval.string = lexeme_alloc(yytext+1); return tINTVAR; }
 
-<PATH_EXPECTED>{PATHNAME}              { yylval.string = lexeme_alloc(yytext); return tPATH; }
-
 <*>[ \t\r]+                             /* Eat up whitespace and DOS LF */
 
 <NOPROCESS>.                            { BEGIN(ASTRING_EXPECTED); yyless(0); return tNOPROCESS;}