Allow _ in identifier names.

This commit is contained in:
Gunnar Beutner 2012-06-13 09:21:39 +02:00
parent 7750242384
commit 01c2da2853
2 changed files with 2 additions and 2 deletions

View File

@ -402,7 +402,7 @@ static yyconst flex_int32_t yy_ec[256] =
11, 1, 1, 1, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
1, 1, 1, 1, 1, 1, 13, 14, 15, 16,
1, 1, 1, 1, 12, 1, 13, 14, 15, 16,
17, 12, 12, 18, 19, 20, 12, 21, 12, 22,
23, 12, 12, 24, 25, 26, 27, 12, 12, 12,

View File

@ -52,7 +52,7 @@ object return T_OBJECT;
include return T_INCLUDE;
inherits return T_INHERITS;
null return T_NULL;
[a-zA-Z][a-zA-Z0-9\-]* { yylval->text = strdup(yytext); return T_IDENTIFIER; }
[a-zA-Z_][a-zA-Z0-9\-_]* { yylval->text = strdup(yytext); return T_IDENTIFIER; }
\"[^\"]+\" { yytext[yyleng-1] = '\0'; yylval->text = strdup(yytext + 1); return T_STRING; }
[0-9]+ { yylval->num = atoi(yytext); return T_NUMBER; }
= { yylval->op = OperatorSet; return T_EQUAL; }