mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-09 23:10:11 -04:00
feat: add lalrpop parser (#2524)
LALRPOP is a parser generator for Rust. This only parses the LALRPOP side of the generator, not the nearly-rust code of the actions.
This commit is contained in:
parent
6e7c8c4fed
commit
ca64d8b028
4 changed files with 72 additions and 0 deletions
57
queries/lalrpop/highlights.scm
Normal file
57
queries/lalrpop/highlights.scm
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
[
|
||||
"pub"
|
||||
"grammar"
|
||||
"match"
|
||||
"extern"
|
||||
"type"
|
||||
"enum"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"+"
|
||||
"*"
|
||||
"?"
|
||||
] @operator
|
||||
|
||||
(grammar_type_params
|
||||
"<" @punctuation.bracket
|
||||
">" @punctuation.bracket)
|
||||
|
||||
(symbol
|
||||
"<" @punctuation.bracket
|
||||
">" @punctuation.bracket)
|
||||
|
||||
(binding_symbol
|
||||
"<" @punctuation.bracket
|
||||
">" @punctuation.bracket)
|
||||
|
||||
(binding_symbol
|
||||
name: (identifier) @parameter)
|
||||
|
||||
(bare_symbol
|
||||
(macro
|
||||
((macro_id) @function)))
|
||||
|
||||
(bare_symbol
|
||||
(identifier) @function)
|
||||
|
||||
(nonterminal_name
|
||||
(macro_id) @function)
|
||||
|
||||
(nonterminal_name
|
||||
(identifier) @function)
|
||||
|
||||
(nonterminal
|
||||
(type_ref) @type)
|
||||
|
||||
"(" @punctuation.bracket
|
||||
")" @punctuation.bracket
|
||||
"[" @punctuation.bracket
|
||||
"]" @punctuation.bracket
|
||||
|
||||
";" @punctuation.delimiter
|
||||
|
||||
(lifetime (identifier) @label)
|
||||
|
||||
(string_literal) @string
|
||||
(regex_literal) @string
|
||||
5
queries/lalrpop/locals.scm
Normal file
5
queries/lalrpop/locals.scm
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
(nonterminal_name
|
||||
(macro_id) @definition.function)
|
||||
|
||||
(nonterminal_name
|
||||
(identifier) @definition.function)
|
||||
Loading…
Add table
Add a link
Reference in a new issue