mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
Add devicetree parser with queries
This commit is contained in:
parent
a077f61b67
commit
2d72fc34d9
5 changed files with 68 additions and 0 deletions
|
|
@ -416,6 +416,15 @@ list.turtle = {
|
|||
maintainers = { "@bonabeavis" },
|
||||
}
|
||||
|
||||
list.devicetree = {
|
||||
install_info = {
|
||||
url = "https://github.com/joelspadin/tree-sitter-devicetree",
|
||||
files = { "src/parser.c" },
|
||||
branch = "main",
|
||||
},
|
||||
filetype = 'dts',
|
||||
}
|
||||
|
||||
local M = {
|
||||
list = list
|
||||
}
|
||||
|
|
|
|||
1
queries/devicetree/folds.scm
Normal file
1
queries/devicetree/folds.scm
Normal file
|
|
@ -0,0 +1 @@
|
|||
(node) @fold
|
||||
40
queries/devicetree/highlights.scm
Normal file
40
queries/devicetree/highlights.scm
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
(comment) @comment
|
||||
|
||||
[
|
||||
(preproc_include)
|
||||
(dtsi_include)
|
||||
] @include
|
||||
|
||||
[
|
||||
(preproc_def)
|
||||
] @constant.macro
|
||||
|
||||
[
|
||||
(preproc_function_def)
|
||||
] @function.macro
|
||||
|
||||
[
|
||||
(memory_reservation)
|
||||
(file_version)
|
||||
] @annotation
|
||||
|
||||
[
|
||||
(string_literal)
|
||||
(byte_string_literal)
|
||||
(system_lib_string)
|
||||
] @string
|
||||
|
||||
(integer_literal) @number
|
||||
|
||||
(identifier) @variable
|
||||
(node (identifier) @attribute)
|
||||
(property (identifier) @property)
|
||||
(labeled_item (identifier) @label)
|
||||
(call_expression (identifier) @function.macro)
|
||||
|
||||
(reference) @attribute
|
||||
(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