feat: add Forth

This commit is contained in:
Amaan Qureshi 2023-08-21 04:29:38 -04:00
parent 620b60b5ba
commit 7c935d6bd5
8 changed files with 42 additions and 0 deletions

View file

@ -222,6 +222,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [firrtl](https://github.com/amaanq/tree-sitter-firrtl) (maintained by @amaanq)
- [x] [fish](https://github.com/ram02z/tree-sitter-fish) (maintained by @ram02z)
- [x] [foam](https://github.com/FoamScience/tree-sitter-foam) (experimental, maintained by @FoamScience)
- [x] [forth](https://github.com/AlexanderBrevig/tree-sitter-forth) (maintained by @amaanq)
- [x] [fortran](https://github.com/stadelmanma/tree-sitter-fortran) (maintained by @amaanq)
- [x] [fsh](https://github.com/mgramigna/tree-sitter-fsh) (maintained by @mgramigna)
- [x] [func](https://github.com/amaanq/tree-sitter-func) (maintained by @amaanq)

View file

@ -146,6 +146,9 @@
"foam": {
"revision": "09e03445f49290450589c5d293610ab39434e3e4"
},
"forth": {
"revision": "304ed77beb113e37af38b20ff14e3c37bf350d10"
},
"fortran": {
"revision": "6828cf3629addb1706bdbbd33491e95f12b7042c"
},

View file

@ -487,6 +487,14 @@ list.foam = {
experimental = true,
}
list.forth = {
install_info = {
url = "https://github.com/AlexanderBrevig/tree-sitter-forth",
files = { "src/parser.c" },
},
maintainers = { "@amaanq" },
}
list.fortran = {
install_info = {
url = "https://github.com/stadelmanma/tree-sitter-fortran",

1
queries/forth/folds.scm Normal file
View file

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

View file

@ -0,0 +1,21 @@
(core) @function
(operator) @operator
(word) @variable
((word) @constant
(#lua-match? @constant "^[A-Z_]+$"))
(number) @number
(string) @string
[
(start_definition)
(end_definition)
] @punctuation.delimiter
(comment) @comment
(ERROR) @error

View file

@ -0,0 +1,3 @@
(word_definition) @indent.begin
(end_definition) @indent.end @indent.branch

View file

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

3
queries/forth/locals.scm Normal file
View file

@ -0,0 +1,3 @@
(word) @reference
(word_definition) @scope