FallenAngel97 / tree-sitter-rego

https://decodeapps.pp.ua/blog/post/rego-treesitter
MIT License
11 stars 6 forks source link

Parsing error - reference heads #7

Open krzykli opened 1 year ago

krzykli commented 1 year ago

Repro case

package test
fruit.apple.seeds = 12 if input.word == "apple"

resulting syntax tree

(source_file
  (module
    (package)
    (ref
      (var)
      (ref_arg
        (ref_arg_dot
          (var))))
    (policy
      (rule
        (rule_head
          (var))
        (ERROR
          (keyword)
          (keyword)
          (unification))
        (rule_body
          (literal
            (expr
              (term
                (scalar
                  (number)))))))
      (rule
        (rule_head
          (var))
        (rule_body
          (literal
            (expr
              (expr_infix
                (expr
                  (term
                    (ref
                       (var)
                          (ref_arg
                            (ref_arg_dot
                              (var))))))
                (infix_operator
                  (bool_operator))
                (expr
                  (term
                    (scalar
                      (string))))))))))))