feat(bp): add support for Android Blueprint (#6626)

This commit is contained in:
Bruno BELANYI 2024-05-23 17:30:26 +02:00 committed by GitHub
parent 3e454836ce
commit 298a9dd4f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 125 additions and 0 deletions

View file

@ -189,6 +189,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [bicep](https://github.com/amaanq/tree-sitter-bicep) (maintained by @amaanq)
- [x] [bitbake](https://github.com/amaanq/tree-sitter-bitbake) (maintained by @amaanq)
- [x] [blueprint](https://gitlab.com/gabmus/tree-sitter-blueprint.git) (experimental, maintained by @gabmus)
- [x] [bp](https://github.com/ambroisie/tree-sitter-bp) (maintained by @ambroisie)
- [x] [c](https://github.com/tree-sitter/tree-sitter-c) (maintained by @amaanq)
- [x] [c_sharp](https://github.com/tree-sitter/tree-sitter-c-sharp) (maintained by @amaanq)
- [x] [cairo](https://github.com/amaanq/tree-sitter-cairo) (maintained by @amaanq)

View file

@ -47,6 +47,9 @@
"blueprint": {
"revision": "60ba73739c6083c693d86a1a7cf039c07eb4ed59"
},
"bp": {
"revision": "2326d709fb9cf73cf124fdbc803c267f851721a4"
},
"c": {
"revision": "82fb86aa544843bd17a9f0f3dc16edf645a34349"
},

View file

@ -210,6 +210,14 @@ list.blueprint = {
experimental = true,
}
list.bp = {
install_info = {
url = "https://github.com/ambroisie/tree-sitter-bp",
files = { "src/parser.c" },
},
maintainers = { "@ambroisie" },
}
list.c = {
install_info = {
url = "https://github.com/tree-sitter/tree-sitter-c",

6
queries/bp/folds.scm Normal file
View file

@ -0,0 +1,6 @@
[
(list_expression)
(map_expression)
(module)
(select_expression)
] @fold

55
queries/bp/highlights.scm Normal file
View file

@ -0,0 +1,55 @@
(comment) @comment @spell
(operator) @operator
(integer_literal
"-" @operator)
[
","
":"
] @punctuation.delimiter
[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket
(boolean_literal) @boolean
(integer_literal) @number
[
(raw_string_literal)
(interpreted_string_literal)
] @string
(escape_sequence) @string.escape
(identifier) @variable
(module
type: (identifier) @function.call)
(module
(property
field: (identifier) @variable.parameter))
[
(unset)
(default)
] @variable.builtin
(condition
name: (identifier) @function.builtin)
(map_expression
(property
field: (identifier) @property))
(select_expression
"select" @keyword.conditional)

38
queries/bp/indents.scm Normal file
View file

@ -0,0 +1,38 @@
(list_expression) @indent.begin
(list_expression
"]" @indent.branch)
(map_expression) @indent.begin
(map_expression
"}" @indent.branch)
(select_expression) @indent.begin
(select_expression
")" @indent.branch)
(select_value) @indent.begin
(select_value
")" @indent.branch)
(select_pattern
"(" @indent.begin)
(select_pattern
")" @indent.branch)
(select_cases) @indent.begin
(select_cases
"}" @indent.branch)
(module) @indent.begin
(module
")" @indent.branch)
(module
"}" @indent.branch)

View file

@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))

12
queries/bp/locals.scm Normal file
View file

@ -0,0 +1,12 @@
(module
(property
field: (identifier) @local.definition.parameter))
(map_expression
(property
field: (identifier) @local.definition.field))
(assignment
left: (identifier) @local.definition.var)
(identifier) @local.reference