Commit 28c2b549 authored by C. Scott Ananian's avatar C. Scott Ananian Committed by Alexandre Julliard

Move definition of 'tPATH' token up, so that '/', '.' and '0xA' (etc)

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.
parent 940d8575
......@@ -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;}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment