mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
rego: update parser and queries (#3805)
Co-authored-by: Oleksii Demennikov <odemennikov@lohika.com>
This commit is contained in:
parent
2072692aaa
commit
34807c605a
2 changed files with 60 additions and 12 deletions
|
|
@ -297,7 +297,7 @@
|
|||
"revision": "e1cfca3c79896ff79842f057ea13e529b66af636"
|
||||
},
|
||||
"rego": {
|
||||
"revision": "6d70da3a998fd0081efc5d1019c71e74cc1568e9"
|
||||
"revision": "8778c41757e2ae6738d64da114ea23868dedf349"
|
||||
},
|
||||
"rnoweb": {
|
||||
"revision": "502c1126dc6777f09af5bef16e72a42f75bd081e"
|
||||
|
|
|
|||
|
|
@ -1,16 +1,64 @@
|
|||
; highlights.scm
|
||||
"import" @include
|
||||
"package" @include
|
||||
[
|
||||
(import)
|
||||
(package)
|
||||
] @include
|
||||
|
||||
[
|
||||
(with)
|
||||
(as)
|
||||
(every)
|
||||
(some)
|
||||
(in)
|
||||
(not)
|
||||
(if)
|
||||
(contains)
|
||||
(else)
|
||||
(default)
|
||||
"null"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"true"
|
||||
"false"
|
||||
] @boolean
|
||||
|
||||
[
|
||||
(assignment_operator)
|
||||
(bool_operator)
|
||||
(arith_operator)
|
||||
(bin_operator)
|
||||
] @operator
|
||||
|
||||
[
|
||||
(string)
|
||||
(raw_string)
|
||||
] @string
|
||||
|
||||
(term (ref (var))) @variable
|
||||
|
||||
(reserved_keywords) @keyword
|
||||
(comment) @comment
|
||||
(rego_block rego_rule_name: (identifier) @function)
|
||||
(builtin_function function_name: (function_name) @function.builtin)
|
||||
(opening_parameter) @punctuation.bracket
|
||||
(closing_parameter) @punctuation.bracket
|
||||
(string_definition) @string
|
||||
|
||||
(number) @number
|
||||
(operator) @operator
|
||||
(true) @boolean
|
||||
(false) @boolean
|
||||
|
||||
(expr_call func_name: (fn_name (var) @function .))
|
||||
|
||||
(expr_call func_arguments: (fn_args (expr) @parameter))
|
||||
|
||||
(rule_args (term) @parameter)
|
||||
|
||||
[
|
||||
(open_paren)
|
||||
(close_paren)
|
||||
(open_bracket)
|
||||
(close_bracket)
|
||||
(open_curly)
|
||||
(close_curly)
|
||||
] @punctuation.bracket
|
||||
|
||||
(rule (rule_head (var) @method))
|
||||
|
||||
(rule
|
||||
(rule_head (term (ref (var) @namespace)))
|
||||
(rule_body (query (literal (expr (expr_infix (expr (term (ref (var)) @_output)))))) (#eq? @_output @namespace))
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue