From 0ad7a333dc2b45f0ba658ea455284d086294a088 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 21 Apr 2020 14:06:15 +0200 Subject: grammar: fix precendence rules If we don't allow the higher-tier on the left side, we cannot chain multiple or/and on the same level. Since or is associative, we shouldn't expect the user to write (... or (... or ...)) and instead provide the flattened version as well. --- src/fexpr/grammar.lalrpop | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fexpr/grammar.lalrpop b/src/fexpr/grammar.lalrpop index f559ff1..caaaf7f 100644 --- a/src/fexpr/grammar.lalrpop +++ b/src/fexpr/grammar.lalrpop @@ -28,18 +28,18 @@ PlayerFilter: Box = { } Disjunction: T = { - > "or" > => a | b, + > "or" > => a | b, Conjunction, } Conjunction: T = { - > "and"? > => a & b, + > "and"? > => a & b, Negation, } Negation: T = { - "not" => ! <>, - "!" => ! <>, + "not" > => ! <>, + "!" > => ! <>, T, } -- cgit v1.2.3