Commit baa3680f authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

widl: Introduce a new helper to produce num tokens.

parent a46facfd
......@@ -131,6 +131,12 @@ struct uuid *parse_uuid(const char *u)
return uuid;
}
static int token_num( int token, const char *yytext, YYSTYPE *yylval )
{
yylval->num = xstrtoul( yytext, NULL, 0 );
return token;
}
%}
/*
......@@ -227,14 +233,8 @@ SAFEARRAY{ws}*/\( return tSAFEARRAY;
^{ws}*\#{ws}* { yy_push_state(PP_LINE); }
\[ { yy_push_state(ATTR); return '['; }
{hex} {
yylval->num = xstrtoul(yytext, NULL, 0);
return aHEXNUM;
}
{int} {
yylval->num = xstrtoul(yytext, NULL, 0);
return aNUM;
}
{hex} { return token_num( aHEXNUM, yytext, yylval ); }
{int} { return token_num( aNUM, yytext, yylval ); }
\n { line_number++; }
{ws} {}
......
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