diff --git a/src/parser/mod.rs b/src/parser/mod.rs index 0419cbea..a4248ff3 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -143,7 +143,7 @@ fn parse_test(pair: Pair) -> TeraResult { for p in pair.into_inner() { match p.as_rule() { - Rule::dotted_ident => ident = Some(p.as_str().to_string()), + Rule::dotted_square_bracket_ident => ident = Some(p.as_str().to_string()), Rule::test_call => { let (_name, _args) = parse_test_call(p)?; name = Some(_name); diff --git a/src/parser/tera.pest b/src/parser/tera.pest index 0c897537..03c74748 100644 --- a/src/parser/tera.pest +++ b/src/parser/tera.pest @@ -138,8 +138,8 @@ macro_call = { ident ~ "::" ~ ident ~ "(" ~ kwargs? ~ ")" } test_arg = { logic_expr | array_filter } test_args = _{ test_arg ~ ("," ~ test_arg)* } test_call = !{ ident ~ ("(" ~ test_args ~ ")")? } -test_not = { dotted_ident ~ "is" ~ "not" ~ test_call } -test = { dotted_ident ~ "is" ~ test_call } +test_not = { dotted_square_bracket_ident ~ "is" ~ "not" ~ test_call } +test = { dotted_square_bracket_ident ~ "is" ~ test_call } // -------------------------------------------------------