mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-16 10:20:11 -04:00
Adding cedars policy language with queries
This commit is contained in:
parent
20fc6b1270
commit
f10b0d8ab0
2 changed files with 57 additions and 0 deletions
6
queries/cedar/folds.scm
Normal file
6
queries/cedar/folds.scm
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
[
|
||||||
|
(policy)
|
||||||
|
(record_literal)
|
||||||
|
(set_literal)
|
||||||
|
(condition)
|
||||||
|
] @fold
|
||||||
51
queries/cedar/highlights.scm
Normal file
51
queries/cedar/highlights.scm
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
|
||||||
|
; Main policy structure
|
||||||
|
(policy) @keyword
|
||||||
|
(effect) @keyword
|
||||||
|
(scope) @keyword
|
||||||
|
|
||||||
|
; Expressions
|
||||||
|
(binary_expression) @operator
|
||||||
|
(unary_expression) @operator
|
||||||
|
(call_expression) @function.call
|
||||||
|
(ext_fun_call) @function.call
|
||||||
|
(selector_expression) @property
|
||||||
|
(has_expression) @operator
|
||||||
|
(like_expression) @operator
|
||||||
|
(contains_expression) @operator
|
||||||
|
(contains_all_expression) @operator
|
||||||
|
(is_expression) @operator
|
||||||
|
|
||||||
|
; Literals
|
||||||
|
(record_literal) @punctuation.bracket
|
||||||
|
(set_literal) @punctuation.bracket
|
||||||
|
(entity) @constant
|
||||||
|
|
||||||
|
; Conditions
|
||||||
|
(condition) @keyword
|
||||||
|
|
||||||
|
; Annotations
|
||||||
|
(annotation) @attribute
|
||||||
|
|
||||||
|
; Constraints
|
||||||
|
(principal_constraint) @variable.builtin
|
||||||
|
(action_constraint) @variable.builtin
|
||||||
|
(resource_constraint) @variable.builtin
|
||||||
|
|
||||||
|
; Basic punctuation
|
||||||
|
[
|
||||||
|
"("
|
||||||
|
")"
|
||||||
|
"{"
|
||||||
|
"}"
|
||||||
|
"["
|
||||||
|
"]"
|
||||||
|
] @punctuation.bracket
|
||||||
|
|
||||||
|
[
|
||||||
|
","
|
||||||
|
";"
|
||||||
|
"."
|
||||||
|
"::"
|
||||||
|
"@"
|
||||||
|
] @punctuation.delimiter
|
||||||
Loading…
Add table
Add a link
Reference in a new issue