Expression parser: Fixed parsing of numbers like 2e3 (with e/E, but without decimal part).

This commit is contained in:
Eivind Kvedalen 2015-09-23 20:05:01 +02:00
parent 28fe9b481d
commit 7b39e233e3
2 changed files with 4917 additions and 4594 deletions

View File

@ -247,6 +247,7 @@ EXPO [eE][-+]?[0-9]+
{DIGIT}*"."{DIGIT}+{EXPO}? COUNT; yylval.fvalue = num_change(yytext,'.',','); return yylval.fvalue == 1 ? ONE : NUM;
{DIGIT}*","{DIGIT}+{EXPO}? COUNT; yylval.fvalue = num_change(yytext,',','.'); return yylval.fvalue == 1 ? ONE : NUM;
{DIGIT}+{EXPO} COUNT; yylval.fvalue = num_change(yytext,',','.'); return yylval.fvalue == 1 ? ONE : NUM;
{DIGIT}+ COUNT; yylval.ivalue = strtoll( yytext, NULL, 0 ); if (yylval.ivalue == 1) { yylval.fvalue = 1; return ONE; } else return INTEGER;
"pi" COUNT; yylval.constant.fvalue = M_PI; yylval.constant.name = "pi"; return CONSTANT; // constant pi

File diff suppressed because it is too large Load Diff