mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-11 07:50:07 -04:00
feat(authzed): add parser and highlight queries. (#5426)
* feat(authzed): add parser and highlight queries * Update queries/authzed/highlights.scm use `any-of` for list of alternative words. Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com> * add injections queries file. * Update queries/authzed/highlights.scm * tweak whitespace * fix errors with capture names. * style(authzed): reformat highlights * add self as maintainer * Update lua/nvim-treesitter/parsers.lua Co-authored-by: Christian Clason <c.clason@uni-graz.at> * Add to lockfile and readme * feat(authzed): Updates to queries and lockfile around newest Authzed parser changes. * Update queries/authzed/highlights.scm Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com> * Update queries/authzed/highlights.scm Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com> * unnest here similarly to recommended elsewhere * Update highlights.scm Co-authored-by: ObserverOfTime <chronobserver@disroot.org> --------- Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com> Co-authored-by: ObserverOfTime <chronobserver@disroot.org> Co-authored-by: Christian Clason <c.clason@uni-graz.at>
This commit is contained in:
parent
10bfa4826f
commit
3a2cc3161e
5 changed files with 72 additions and 0 deletions
58
queries/authzed/highlights.scm
Normal file
58
queries/authzed/highlights.scm
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
(identifier) @function
|
||||
|
||||
(block
|
||||
(relation
|
||||
(relation_literal) @function.builtin
|
||||
(identifier) @constant))
|
||||
|
||||
(block
|
||||
(permission
|
||||
(permission_literal) @variable.builtin
|
||||
(identifier) @type))
|
||||
|
||||
; relations
|
||||
(rel_expression (identifier) @property)
|
||||
|
||||
(relation
|
||||
(rel_expression
|
||||
(hash_literal)
|
||||
.
|
||||
(identifier) @constant))
|
||||
|
||||
; permissions
|
||||
(perm_expression (identifier) @property)
|
||||
|
||||
(call_expression
|
||||
function: (selector_expression
|
||||
operand: (identifier) @constant
|
||||
field: (field_identifier) @function.method))
|
||||
|
||||
(perm_expression
|
||||
(stabby) @operator
|
||||
.
|
||||
(identifier) @function)
|
||||
|
||||
; misc
|
||||
[
|
||||
(plus_literal)
|
||||
(minus_literal)
|
||||
(amp_literal)
|
||||
(pipe_literal)
|
||||
] @operator
|
||||
|
||||
[
|
||||
(true)
|
||||
(false)
|
||||
] @boolean
|
||||
|
||||
(nil) @constant.builtin
|
||||
|
||||
[
|
||||
(caveat_literal)
|
||||
(definition_literal)
|
||||
] @keyword
|
||||
|
||||
[
|
||||
(hash_literal)
|
||||
(comment)
|
||||
] @comment
|
||||
2
queries/authzed/injections.scm
Normal file
2
queries/authzed/injections.scm
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue