yylval, strdup instead of pointer on str
This commit is contained in:
parent
8f722d7896
commit
fa70beb1a4
10
src/ram.l
10
src/ram.l
@ -9,11 +9,11 @@
|
|||||||
|
|
||||||
|
|
||||||
%%
|
%%
|
||||||
[rio][0-9]* { yylval = yytext; return REGISTER;}
|
[rio][0-9]* { yylval = strdup(yytext); return REGISTER;}
|
||||||
[rio]@[rio][0-9]* { yylval = yytext; return REGISTER_REF;}
|
[rio]@[rio][0-9]* { yylval = strdup(yytext); return REGISTER_REF;}
|
||||||
[0-9]* { yylval = yytext; return VALUE;}
|
[0-9]* { yylval = strdup(yytext); return VALUE;}
|
||||||
ADD|SUB|MULT|DIV { yylval = yytext; return OP;}
|
ADD|SUB|MULT|DIV { yylval = strdup(yytext); return OP;}
|
||||||
JUMP|JE|JL { yylval = yytext; return OP_CTRL;}
|
JUMP|JE|JL { yylval = strdup(yytext); return OP_CTRL;}
|
||||||
[ ]*,[ ]* {return COMMA;}
|
[ ]*,[ ]* {return COMMA;}
|
||||||
\( {return PAR_O;}
|
\( {return PAR_O;}
|
||||||
\) {return PAR_C;}
|
\) {return PAR_C;}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user