mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -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
|
|
@ -205,6 +205,7 @@ We are looking for maintainers to add more parsers and to write query files for
|
|||
- [x] [JSON with comments](https://gitlab.com/WhyNotHugo/tree-sitter-jsonc.git) (maintained by @WhyNotHugo)
|
||||
- [x] [julia](https://github.com/tree-sitter/tree-sitter-julia) (maintained by @mroavi, @theHamsta)
|
||||
- [x] [kotlin](https://github.com/fwcd/tree-sitter-kotlin) (maintained by @SalBakraa)
|
||||
- [x] [lalrpop](https://github.com/traxys/tree-sitter-lalrpop) (maintained by @traxys)
|
||||
- [x] [latex](https://github.com/latex-lsp/tree-sitter-latex) (maintained by @theHamsta, @clason)
|
||||
- [x] [ledger](https://github.com/cbarrete/tree-sitter-ledger) (maintained by @cbarrete)
|
||||
- [x] [llvm](https://github.com/benwilliamgraham/tree-sitter-llvm) (maintained by @benwilliamgraham)
|
||||
|
|
|
|||
|
|
@ -920,6 +920,15 @@ list.vala = {
|
|||
maintainers = { "@matbme" },
|
||||
}
|
||||
|
||||
list.lalrpop = {
|
||||
install_info = {
|
||||
url = "https://github.com/traxys/tree-sitter-lalrpop",
|
||||
branch = "master",
|
||||
files = { "src/parser.c", "src/scanner.c" },
|
||||
},
|
||||
maintainers = { "@traxys" },
|
||||
}
|
||||
|
||||
local M = {
|
||||
list = list,
|
||||
filetype_to_parsername = filetype_to_parsername,
|
||||
|
|
|
|||
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