From 85fe4a819ca52ffbe99dd0d7820b5cd6219c50f1 Mon Sep 17 00:00:00 2001 From: volth Date: Sat, 21 Jul 2018 15:24:51 +0000 Subject: [PATCH 1/2] parser.y: fix assoc of -> and < > <= >= The parser allowed senseless `a > b > c` but disallowed `a -> b -> c` which seems valid It might be a typo --- src/libexpr/parser.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y index eee48887d..3ef896692 100644 --- a/src/libexpr/parser.y +++ b/src/libexpr/parser.y @@ -273,11 +273,11 @@ void yyerror(YYLTYPE * loc, yyscan_t scanner, ParseData * data, const char * err %token IND_STRING_OPEN IND_STRING_CLOSE %token ELLIPSIS -%nonassoc IMPL +%left IMPL %left OR %left AND %nonassoc EQ NEQ -%left '<' '>' LEQ GEQ +%nonassoc '<' '>' LEQ GEQ %right UPDATE %left NOT %left '+' '-' From deaa6e9a34f24c1fdfeed0b98054c28e50100c12 Mon Sep 17 00:00:00 2001 From: volth Date: Mon, 23 Jul 2018 07:28:48 +0000 Subject: [PATCH 2/2] parser.y: right-associativity of -> --- src/libexpr/parser.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y index 3ef896692..cbd576d7d 100644 --- a/src/libexpr/parser.y +++ b/src/libexpr/parser.y @@ -273,7 +273,7 @@ void yyerror(YYLTYPE * loc, yyscan_t scanner, ParseData * data, const char * err %token IND_STRING_OPEN IND_STRING_CLOSE %token ELLIPSIS -%left IMPL +%right IMPL %left OR %left AND %nonassoc EQ NEQ