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:
Jędrzej Boczar 2021-02-10 22:18:38 +01:00 committed by GitHub
parent 98127bded6
commit 517c62d3e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 65 additions and 0 deletions

View file

@ -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)

View file

@ -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
}

View file

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

View 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

View file

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

View file

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