scan real numbers
This commit is contained in:
parent
0515b8ba2a
commit
7f04cad34d
|
@ -19,7 +19,9 @@ struct parser_control {
|
|||
[ \t\n\r] /* skip whitespace */
|
||||
"(" return tLPAREN;
|
||||
")" return tRPAREN;
|
||||
[1-9][0-9]* { yylval.datum = pic_float_value(atoi(yytext)); return tNUMBER; }
|
||||
[0-9]+ { yylval.datum = pic_float_value(atoi(yytext)); return tNUMBER; }
|
||||
\.[0-9]+ { yylval.datum = pic_float_value(atof(yytext)); return tNUMBER; }
|
||||
[0-9]+\.[0-9]* { yylval.datum = pic_float_value(atof(yytext)); return tNUMBER; }
|
||||
[a-z0-9A-Z+-/*]+ { yylval.datum = pic_intern_cstr(p->pic, yytext); return tSYMBOL; }
|
||||
|
||||
%%
|
||||
|
|
Loading…
Reference in New Issue