From 970b45ac3c90a3b43ec1b353dd77999a4138aff3 Mon Sep 17 00:00:00 2001 From: servostar Date: Tue, 30 Apr 2024 11:51:59 +0200 Subject: [PATCH] added less and greater operator --- prog.gem | 1 + src/yacc/parser.y | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 prog.gem diff --git a/prog.gem b/prog.gem new file mode 100644 index 0000000..d4504b9 --- /dev/null +++ b/prog.gem @@ -0,0 +1 @@ +foo(1,2,bar) \ No newline at end of file diff --git a/src/yacc/parser.y b/src/yacc/parser.y index 7e3ef61..4941825 100644 --- a/src/yacc/parser.y +++ b/src/yacc/parser.y @@ -58,7 +58,7 @@ /* Operator associativity */ %right '=' %left '+' '-' '*' '/' -%left OpEquals OpNot +%left OpEquals OpNot '<' '>' %left OpAnd OpOr OpXor %left OpBitand OpBitor OpBitxor OpBitnot @@ -108,7 +108,9 @@ oparith: expr '+' expr | expr '/' expr | '-' expr %prec '*'; -oplogic: expr OpEquals expr; +oplogic: expr OpEquals expr + | expr '<' expr + | expr '>' expr; opbool: expr OpAnd expr | expr OpOr expr