Add devicetree parser with queries

This commit is contained in:
Jędrzej Boczar 2021-01-31 22:38:51 +01:00
parent a077f61b67
commit 2d72fc34d9
5 changed files with 68 additions and 0 deletions

View file

@ -0,0 +1 @@
(node) @fold

View 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

View file

@ -0,0 +1,14 @@
[
(node)
(property)
(integer_cells)
] @indent
[
"}"
">"
] @branch
[
(comment)
] @ignore

View file

@ -0,0 +1,4 @@
[
(node)
(integer_cells)
]@scope