wrc: Allow '/' and '\' in identifiers.

This commit is contained in:
Jacek Caban 2013-04-23 14:13:58 +02:00 committed by Alexandre Julliard
parent 68c4f61dc5
commit 0da8be91ef
2 changed files with 3 additions and 12 deletions

View File

@ -404,14 +404,7 @@ static unsigned long xstrtoul(const char *nptr, char **endptr, int base)
0[oO][0-7]+[lL]? { parser_lval.num = xstrtoul(yytext+2, 0, 8);
return (yytext[yyleng-1] == 'L' || yytext[yyleng-1] == 'l') ? tLNUMBER : tNUMBER; }
/*
* The next two rules scan identifiers and filenames.
* This is achieved by using the priority ruling
* of the scanner where a '.' is valid in a filename
* and *only* in a filename. In this case, the second
* rule will be reduced because it is longer.
*/
[A-Za-z_0-9.]+ {
[A-Za-z_0-9./\\]+ {
struct keyword *tok = iskeyword(yytext);
if(tok)
@ -430,7 +423,6 @@ static unsigned long xstrtoul(const char *nptr, char **endptr, int base)
return tIDENT;
}
}
[A-Za-z_0-9./\\]+ parser_lval.str = make_string(yytext); return tFILENAME;
/*
* Wide string scanning

View File

@ -268,7 +268,7 @@ static int rsrcid_to_token(int lookahead);
%token tNL
%token <num> tNUMBER tLNUMBER
%token <str> tSTRING tIDENT tFILENAME
%token <str> tSTRING tIDENT
%token <raw> tRAWDATA
%token tACCELERATORS tBITMAP tCURSOR tDIALOG tDIALOGEX tMENU tMENUEX tMESSAGETABLE
%token tRCDATA tVERSIONINFO tSTRINGTABLE tFONT tFONTDIR tICON tHTML
@ -647,8 +647,7 @@ resource_definition
;
filename: tFILENAME { $$ = make_filename($1); }
| tIDENT { $$ = make_filename($1); }
filename: tIDENT { $$ = make_filename($1); }
| tSTRING { $$ = make_filename($1); }
;