nvim-treesitter/queries/lalrpop/highlights.scm
Gartox 7e9139db68 feat(lalrpop): highlight annotation macros
Lalrpop support putting annotation like `#[precedence(level = "1")]`.
This commit aims to highlight `precedence` with the `function.macro`
highlight group, like rust does with its proc macros.
2024-02-13 18:13:53 -05:00

82 lines
918 B
Scheme

[
"enum"
"extern"
"grammar"
"match"
"type"
"pub"
] @keyword
[
"match"
"else"
] @keyword.conditional
[
"+"
"*"
"?"
; TODO: inaccessible node
; =>
"=>@L"
"=>@R"
] @operator
(grammar_type_params
[
"<"
">"
] @punctuation.bracket)
(symbol
[
"<"
">"
] @punctuation.bracket)
(binding_symbol
[
"<"
">"
] @punctuation.bracket)
(binding_symbol
name: (identifier) @variable.parameter)
(bare_symbol
(macro
(macro_id) @type.definition))
(bare_symbol
(identifier) @type.definition)
(nonterminal_name
(macro_id) @type.definition)
(nonterminal_name
(identifier) @type.definition)
(nonterminal
(type_ref) @type.builtin)
[
"("
")"
"["
"]"
] @punctuation.bracket
[
";"
":"
] @punctuation.delimiter
(lifetime
(identifier) @keyword.storage)
(string_literal) @string
(regex_literal) @string
(annotation
(id) @function.macro)