diff options
| author | Amaan Qureshi <amaanq12@gmail.com> | 2023-08-21 04:29:38 -0400 |
|---|---|---|
| committer | Amaan Qureshi <amaanq12@gmail.com> | 2023-08-21 05:04:42 -0400 |
| commit | 7c935d6bd5ecb36e7c6cf6678e1eaa38b85111f3 (patch) | |
| tree | 8282175c347fbb8e42b8b19b544792eb802d5bb0 | |
| parent | Update parsers: css, glsl, jsdoc, scala, sql, wing (diff) | |
| download | nvim-treesitter-7c935d6bd5ecb36e7c6cf6678e1eaa38b85111f3.tar nvim-treesitter-7c935d6bd5ecb36e7c6cf6678e1eaa38b85111f3.tar.gz nvim-treesitter-7c935d6bd5ecb36e7c6cf6678e1eaa38b85111f3.tar.bz2 nvim-treesitter-7c935d6bd5ecb36e7c6cf6678e1eaa38b85111f3.tar.lz nvim-treesitter-7c935d6bd5ecb36e7c6cf6678e1eaa38b85111f3.tar.xz nvim-treesitter-7c935d6bd5ecb36e7c6cf6678e1eaa38b85111f3.tar.zst nvim-treesitter-7c935d6bd5ecb36e7c6cf6678e1eaa38b85111f3.zip | |
feat: add Forth
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | lockfile.json | 3 | ||||
| -rw-r--r-- | lua/nvim-treesitter/parsers.lua | 8 | ||||
| -rw-r--r-- | queries/forth/folds.scm | 1 | ||||
| -rw-r--r-- | queries/forth/highlights.scm | 21 | ||||
| -rw-r--r-- | queries/forth/indents.scm | 3 | ||||
| -rw-r--r-- | queries/forth/injections.scm | 2 | ||||
| -rw-r--r-- | queries/forth/locals.scm | 3 |
8 files changed, 42 insertions, 0 deletions
@@ -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) diff --git a/lockfile.json b/lockfile.json index bc090b73d..8743a10eb 100644 --- a/lockfile.json +++ b/lockfile.json @@ -146,6 +146,9 @@ "foam": { "revision": "09e03445f49290450589c5d293610ab39434e3e4" }, + "forth": { + "revision": "304ed77beb113e37af38b20ff14e3c37bf350d10" + }, "fortran": { "revision": "6828cf3629addb1706bdbbd33491e95f12b7042c" }, diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index a4150c8eb..bd956ea9d 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -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", diff --git a/queries/forth/folds.scm b/queries/forth/folds.scm new file mode 100644 index 000000000..443abb30d --- /dev/null +++ b/queries/forth/folds.scm @@ -0,0 +1 @@ +(word_definition) @fold diff --git a/queries/forth/highlights.scm b/queries/forth/highlights.scm new file mode 100644 index 000000000..e8c53e9ce --- /dev/null +++ b/queries/forth/highlights.scm @@ -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 diff --git a/queries/forth/indents.scm b/queries/forth/indents.scm new file mode 100644 index 000000000..067755433 --- /dev/null +++ b/queries/forth/indents.scm @@ -0,0 +1,3 @@ +(word_definition) @indent.begin + +(end_definition) @indent.end @indent.branch diff --git a/queries/forth/injections.scm b/queries/forth/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/queries/forth/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/queries/forth/locals.scm b/queries/forth/locals.scm new file mode 100644 index 000000000..3a5e191d2 --- /dev/null +++ b/queries/forth/locals.scm @@ -0,0 +1,3 @@ +(word) @reference + +(word_definition) @scope |
