Added support for various binary operations (>=, <=, /= etc). Also bitwise operators | and & are now allowed

This commit is contained in:
jpekkila
2019-10-18 01:52:14 +03:00
parent 26bbfa089d
commit 7c79a98cdc
2 changed files with 6 additions and 7 deletions

View File

@@ -45,17 +45,15 @@ L [a-zA-Z_]
{L}({L}|{D})* { return IDENTIFIER; }
\"(.)*\" { return IDENTIFIER; } /* String */
"==" { return LEQU; }/* Logic operations */
"&&" { return LAND; }
"&&" { return LAND; } /* Logical operations */
"||" { return LOR; }
"<=" { return LLEQU; }
[<>/*+-=]"=" { return BINARY_OP; } /* Generic binary operations */
"++" { return INPLACE_INC; }
"--" { return INPLACE_DEC; }
"+=" { return INPLACE_ADD; }
"-=" { return INPLACE_SUB; }
[-+*/;=\[\]{}(),\.<>] { return yytext[0]; } /* Characters */
[-+*/;=\[\]{}(),\.<>|&] { return yytext[0]; } /* Characters */
"//".* { /* Skip regular comments */ }