From 877a020a6e0e90849fb40844e163b5bfba3bbe0e Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Wed, 3 May 2023 12:14:15 +0200 Subject: [PATCH] Don't proceed `!=` as negate operator --- internal/filter/parser.peg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/filter/parser.peg b/internal/filter/parser.peg index f6359a284..4f3c17132 100644 --- a/internal/filter/parser.peg +++ b/internal/filter/parser.peg @@ -228,10 +228,10 @@ ExistsExpr <- col:(Identifier !Operator !"(" / Identifier &EOF) { / Operator { // panics when the rule doesn't match return nil, nil } -Negate <- ("!" &Operator / "!" &")" / "!" &[&|] / "!" &EOF) { +Negate <- ("!" !"=" &Operator / "!" &")" / "!" &[&|] / "!" &EOF) { panic(fmt.Sprintf("unexpected negate operator %q at pos %d", string(c.text), c.pos.col)) } -/ "!"+ { +/ "!"+ !"=" { ops := string(c.text) if len(ops) > 1 { panic(fmt.Sprintf("unexpected negate operators %q at pos %d", string(c.text), c.pos.col))