Add turtle

This commit is contained in:
BonaBeavis 2021-01-05 12:37:16 +01:00 committed by Thomas Vigouroux
parent bc4019f4be
commit a0f03ec333
6 changed files with 94 additions and 0 deletions

View file

@ -172,6 +172,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [teal](https://github.com/euclidianAce/tree-sitter-teal) (maintained by @euclidianAce)
- [x] [toml](https://github.com/ikatyang/tree-sitter-toml) (maintained by @tk-shirasaka)
- [ ] [tsx](https://github.com/tree-sitter/tree-sitter-typescript)
- [x] [turtle](https://github.com/BonaBeavis/tree-sitter-turtle) (maintained by @bonabeavis)
- [x] [typescript](https://github.com/tree-sitter/tree-sitter-typescript) (maintained by @steelsojka)
- [x] [verilog](https://github.com/tree-sitter/tree-sitter-verilog) (maintained by @zegervdv)
- [ ] [vue](https://github.com/ikatyang/tree-sitter-vue)

View file

@ -399,6 +399,15 @@ list.gdscript = {
maintainers = {"not @tjdevries"},
}
list.turtle = {
install_info = {
url = "https://github.com/BonaBeavis/tree-sitter-turtle",
files = { "src/parser.c" },
branch = "main",
},
maintainers = { "@bonabeavis" },
}
local M = {
list = list
}

4
queries/turtle/folds.scm Normal file
View file

@ -0,0 +1,4 @@
[
(statement)
(blank_node_property_list)
] @fold

View file

@ -0,0 +1,58 @@
(string) @string
(lang_tag) @type
[
"_:"
"<"
">"
(namespace)
] @namespace
[
(iri_reference)
(prefixed_name)
] @variable
(blank_node_label) @variable
"a" @variable.builtin
(integer) @number
[
(decimal)
(double)
] @float
(boolean_literal) @boolean
[
"BASE"
"PREFIX"
"@prefix"
"@base"
] @keyword
[
"."
","
";"
] @punctuation.delimiter
[
"("
")"
"["
"]"
(anon)
] @punctuation.bracket
(comment) @comment
(echar) @string.escape
(rdf_literal
"^^" @type
datatype: (_ ["<" ">" (namespace)] @type) @type)

View file

@ -0,0 +1,10 @@
[
(statement)
(blank_node_property_list)
(collection)
] @indent
[
"]"
")"
] @branch

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

@ -0,0 +1,12 @@
(turtle_doc) @scope
(subject
[
(prefixed_name)
(iri_reference)
] @definition.var)
[
(prefixed_name)
(iri_reference)
] @reference