Lexical numbers may be signed.
This commit is contained in:
parent
e8518c5056
commit
8118203766
|
|
@ -40,11 +40,11 @@
|
||||||
return T_INSTR; }
|
return T_INSTR; }
|
||||||
|
|
||||||
[0-9][0-9]* {
|
[0-9][0-9]* {
|
||||||
yylval.numb = strtoul(yytext, 0, 0);
|
yylval.numb = strtol(yytext, 0, 0);
|
||||||
return T_NUMBER; }
|
return T_NUMBER; }
|
||||||
|
|
||||||
"0x"[0-9a-fA-F]+ {
|
"0x"[0-9a-fA-F]+ {
|
||||||
yylval.numb = strtoul(yytext, 0, 0);
|
yylval.numb = strtol(yytext, 0, 0);
|
||||||
return T_NUMBER; }
|
return T_NUMBER; }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ extern FILE*yyin;
|
||||||
|
|
||||||
%union {
|
%union {
|
||||||
char*text;
|
char*text;
|
||||||
unsigned long numb;
|
long numb;
|
||||||
struct textv_s textv;
|
struct textv_s textv;
|
||||||
comp_operands_t opa;
|
comp_operands_t opa;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue