From 633e6598859fc5104bb28d5cccac845cb5d5198e Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Wed, 18 Jan 2017 20:12:49 -0600 Subject: nqasm: support binary arithmetic operators in immediate operands --- lexer.l | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lexer.l') diff --git a/lexer.l b/lexer.l index 324c3da..9b1548d 100644 --- a/lexer.l +++ b/lexer.l @@ -78,8 +78,12 @@ HEX [0-9a-f] @ { return T_DEREF; } \+ { return T_OPERATOR_ADD; } - { return T_OPERATOR_SUB; } +\* { return T_OPERATOR_MUL; } +\/ { return T_OPERATOR_DIV; } ! { return T_OPERATOR_NOT; } ~ { return T_OPERATOR_INV; } +\( { return T_LPAREN; } +\) { return T_RPAREN; } {DEC}+ { return intlit(yytext, 10, &yylval.lval); } 0x{HEX}+ { return intlit(yytext+2, 16, &yylval.lval); } {SP}*,{SP}* { return T_COMMA; } -- cgit v1.2.3