mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Don't parse the token as a variable if the identifier only contains number
This fixes an issue where floats would be parsed as a variable after brackets
This commit is contained in:
parent
0d01ea939d
commit
4853235d86
1 changed files with 17 additions and 17 deletions
|
@ -204,23 +204,23 @@ varname [a-zA-Z0-9_\"\$]+
|
||||||
\\[\r\n]+ { ; }
|
\\[\r\n]+ { ; }
|
||||||
"//"[^\r\n]* { if( prev_yylex != TOKEN_EOL ) YYLEX( TOKEN_EOL ); }
|
"//"[^\r\n]* { if( prev_yylex != TOKEN_EOL ) YYLEX( TOKEN_EOL ); }
|
||||||
|
|
||||||
<VARIABLES>"size" { BEGIN(INITIAL); YYLEX(TOKEN_SIZE); }
|
<VARIABLES>"size" { BEGIN(INITIAL); YYLEX(TOKEN_SIZE); }
|
||||||
<VARIABLES>[ ]*"." { YYLEX(TOKEN_PERIOD); }
|
<VARIABLES>[ ]*\./([0-9]?[^0-9]) { YYLEX(TOKEN_PERIOD); }
|
||||||
<VARIABLES>\"{string}\" { BEGIN(INITIAL); TextEscapeValue(yytext + 1, strlen( yytext ) - 2 ); YYLEX(TOKEN_STRING); }
|
<VARIABLES>\"{string}\" { BEGIN(INITIAL); TextEscapeValue(yytext + 1, strlen( yytext ) - 2 ); YYLEX(TOKEN_STRING); }
|
||||||
<VARIABLES>{varname} {
|
<VARIABLES>{varname} {
|
||||||
TextValue(yytext, strlen(yytext));
|
TextValue(yytext, strlen(yytext));
|
||||||
YYLEX(TOKEN_IDENTIFIER);
|
YYLEX(TOKEN_IDENTIFIER);
|
||||||
}
|
}
|
||||||
<VARIABLES>[ \t\r\n] {
|
<VARIABLES>[ \t\r\n] {
|
||||||
BEGIN(INITIAL);
|
BEGIN(INITIAL);
|
||||||
unput(yytext[yyleng - 1]);
|
unput(yytext[yyleng - 1]);
|
||||||
yyreducepos(1);
|
yyreducepos(1);
|
||||||
}
|
}
|
||||||
<VARIABLES>. {
|
<VARIABLES>. {
|
||||||
BEGIN(INITIAL);
|
BEGIN(INITIAL);
|
||||||
unput(yytext[yyleng - 1]);
|
unput(yytext[yyleng - 1]);
|
||||||
yyreducepos(1);
|
yyreducepos(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
\"{string}\" { TextEscapeValue( yytext + 1, yyleng - 2 ); YYLEX( TOKEN_STRING ); }
|
\"{string}\" { TextEscapeValue( yytext + 1, yyleng - 2 ); YYLEX( TOKEN_STRING ); }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue