mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 13:47:58 +03:00
Correctly parse identifiers starting with a number and containing non-numeric characters
This commit is contained in:
parent
c4a1175ad0
commit
f0cc34cccf
1 changed files with 8 additions and 1 deletions
|
@ -190,6 +190,7 @@ static bool UseField( void )
|
|||
|
||||
string ([^\\\"\r\n]|\\.)*
|
||||
identifier [^\{\}\(\)\[\]\r\n\,:; \t]
|
||||
nonnumeric [a-zA-Z_\"'?@#`\x80-\xff]
|
||||
alphanum [a-zA-Z0-9_]+
|
||||
varname [a-zA-Z0-9_\"\$]+
|
||||
|
||||
|
@ -312,11 +313,17 @@ varname [a-zA-Z0-9_\"\$]+
|
|||
[\r\n]+ { if (prev_yylex != TOKEN_EOL) YYLEX(TOKEN_EOL); }
|
||||
[ \t] { ; }
|
||||
|
||||
[0-9^`]+ {
|
||||
[0-9]+ {
|
||||
char* p = nullptr;
|
||||
yylval.s.val.intValue = std::strtol(yytext, &p, 10);
|
||||
YYLEX(TOKEN_INTEGER);
|
||||
}
|
||||
|
||||
[0-9\.]+{nonnumeric} {
|
||||
BEGIN(IDENTIFIER);
|
||||
yymore();
|
||||
}
|
||||
|
||||
[0-9\.]+|[0-9\.]+("e+"|"e-")+[0-9\.] {
|
||||
char* p = nullptr;
|
||||
yylval.s.val.floatValue = std::strtof(yytext, &p);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue