mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-03 20:10:10 -04:00
Add devicetree parser with queries (#900)
* Add devicetree parser with queries
* [docgen] Update README.md
skip-checks: true
* queries/devicetree: update highlight capture groups
* minor fix in CONTRIBUTING.md
* Revert "minor fix in CONTRIBUTING.md"
This reverts commit 23622b49db.
* queries/devicetree: add self as maintainer
* [docgen] Update README.md
skip-checks: true
Co-authored-by: Github Actions <actions@github>
This commit is contained in:
parent
98127bded6
commit
517c62d3e5
6 changed files with 65 additions and 0 deletions
|
|
@ -139,6 +139,7 @@ We are looking for maintainers to add more parsers and to write query files for
|
|||
- [x] [cpp](https://github.com/tree-sitter/tree-sitter-cpp) (maintained by @theHamsta)
|
||||
- [x] [css](https://github.com/tree-sitter/tree-sitter-css) (maintained by @TravonteD)
|
||||
- [x] [dart](https://github.com/UserNobody14/tree-sitter-dart) (maintained by @Akin909)
|
||||
- [x] [devicetree](https://github.com/joelspadin/tree-sitter-devicetree) (maintained by @jedrzejboczar)
|
||||
- [ ] [elm](https://github.com/elm-tooling/tree-sitter-elm)
|
||||
- [x] [erlang](https://github.com/AbstractMachinesLab/tree-sitter-erlang) (maintained by @ostera)
|
||||
- [x] [fennel](https://github.com/travonted/tree-sitter-fennel) (maintained by @TravonteD)
|
||||
|
|
|
|||
|
|
@ -416,6 +416,16 @@ list.turtle = {
|
|||
maintainers = { "@bonabeavis" },
|
||||
}
|
||||
|
||||
list.devicetree = {
|
||||
install_info = {
|
||||
url = "https://github.com/joelspadin/tree-sitter-devicetree",
|
||||
files = { "src/parser.c" },
|
||||
branch = "main",
|
||||
},
|
||||
filetype = 'dts',
|
||||
maintainers = { "@jedrzejboczar" },
|
||||
}
|
||||
|
||||
local M = {
|
||||
list = list
|
||||
}
|
||||
|
|
|
|||
1
queries/devicetree/folds.scm
Normal file
1
queries/devicetree/folds.scm
Normal file
|
|
@ -0,0 +1 @@
|
|||
(node) @fold
|
||||
35
queries/devicetree/highlights.scm
Normal file
35
queries/devicetree/highlights.scm
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
(comment) @comment
|
||||
|
||||
[
|
||||
(preproc_include)
|
||||
(dtsi_include)
|
||||
] @include
|
||||
|
||||
(preproc_def) @constant.macro
|
||||
(preproc_function_def) @function.macro
|
||||
|
||||
[
|
||||
(memory_reservation)
|
||||
(file_version)
|
||||
] @attribute
|
||||
|
||||
[
|
||||
(string_literal)
|
||||
(byte_string_literal)
|
||||
(system_lib_string)
|
||||
] @string
|
||||
|
||||
(integer_literal) @number
|
||||
|
||||
(identifier) @variable
|
||||
(node (identifier) @namespace)
|
||||
(property (identifier) @property)
|
||||
(labeled_item (identifier) @label)
|
||||
(call_expression (identifier) @function.macro)
|
||||
|
||||
(reference) @label ; referencing labeled_item.identifier
|
||||
(unit_address) @constant
|
||||
|
||||
[ "=" ] @operator
|
||||
[ "(" ")" "[" "]" "{" "}" "<" ">" ] @punctuation.bracket
|
||||
[ ";" ":" "," "@" ] @punctuation.delimiter
|
||||
14
queries/devicetree/indents.scm
Normal file
14
queries/devicetree/indents.scm
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
[
|
||||
(node)
|
||||
(property)
|
||||
(integer_cells)
|
||||
] @indent
|
||||
|
||||
[
|
||||
"}"
|
||||
">"
|
||||
] @branch
|
||||
|
||||
[
|
||||
(comment)
|
||||
] @ignore
|
||||
4
queries/devicetree/locals.scm
Normal file
4
queries/devicetree/locals.scm
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
[
|
||||
(node)
|
||||
(integer_cells)
|
||||
]@scope
|
||||
Loading…
Add table
Add a link
Reference in a new issue