Add in lexer.l capability to scan negative decimal integers or reals
This commit is contained in:
parent
bb6e1bbaec
commit
f8b6a246ef
|
@ -57,12 +57,9 @@ SIGN [+-]
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
#{SIGN}*{DIGIT}+ { yylval = number(yytext); return TKN_NUMBER; }
|
{SIGN}?{DIGIT}+ { yylval = number(yytext); return TKN_NUMBER; }
|
||||||
#{SIGN}*{DIGIT}+"."{DIGIT}* { yylval = number_real(yytext); return TKN_NUMBER_REAL; }
|
{SIGN}?{DIGIT}+"."{DIGIT}* { yylval = number_real(yytext); return TKN_NUMBER_REAL; }
|
||||||
#{SIGN}*"."{DIGIT}* { yylval = number_real(yytext); return TKN_NUMBER_REAL; }
|
{SIGN}?"."{DIGIT}+ { yylval = number_real(yytext); return TKN_NUMBER_REAL; }
|
||||||
{DIGIT}+ { yylval = number(yytext); return TKN_NUMBER; }
|
|
||||||
{DIGIT}+"."{DIGIT}* { yylval = number_real(yytext); return TKN_NUMBER_REAL; }
|
|
||||||
"."{DIGIT}+ { yylval = number_real(yytext); return TKN_NUMBER_REAL; }
|
|
||||||
|
|
||||||
"\"" { string_buf_ptr = string_buf; BEGIN(strng); }
|
"\"" { string_buf_ptr = string_buf; BEGIN(strng); }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue