mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 11:36:54 -04:00
Adding cedars policy language with queries
This commit is contained in:
parent
42fc28ba91
commit
af8409931b
3 changed files with 67 additions and 0 deletions
|
|
@ -265,6 +265,16 @@ list.capnp = {
|
|||
maintainers = { "@amaanq" },
|
||||
}
|
||||
|
||||
list.cedar = {
|
||||
install_info = {
|
||||
url = "https://github.com/chrnorm/tree-sitter-cedar",
|
||||
branch = "main",
|
||||
files = { "src/parser.c" },
|
||||
},
|
||||
filetype = "cedar",
|
||||
maintainers = { "@edmondop" },
|
||||
}
|
||||
|
||||
list.chatito = {
|
||||
install_info = {
|
||||
url = "https://github.com/ObserverOfTime/tree-sitter-chatito",
|
||||
|
|
|
|||
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