From: Kevin Date: Tue, 12 May 2020 02:01:15 +0000 (-0400) Subject: Add support for "not in"/"notin" to grammar/parser X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8c5a124c5c91806e1199ea8decefb91ab1ad724c;p=thirdparty%2Fjinja.git Add support for "not in"/"notin" to grammar/parser --- diff --git a/grammar.ebnf b/grammar.ebnf index 9a6db39b..7d6ed2e9 100644 --- a/grammar.ebnf +++ b/grammar.ebnf @@ -242,6 +242,16 @@ conditional_expression_logical ; conditional_expression_operator + = + conditional_expression_operator_in + | ( + left:variable_identifier + {SP}* operator:conditional_expression_operator_operations {SP}* + right:variable_identifier + ) + ; + +conditional_expression_operator_in = | ( "not" @@ -251,7 +261,12 @@ conditional_expression_operator ) | ( left:variable_identifier - {SP}* operator:conditional_expression_operator_operations {SP}* + {SP}+ + ( + | ( "not" {SP}* "in" operator:`"notin"` ) + | operator:"in" + ) + {SP}+ right:variable_identifier ) ; @@ -276,7 +291,6 @@ conditional_expression_operator_operations | ">=" | "<" | "<=" - | ( @:"in" SP ) ; variable_tests_logical_operator