aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Brevig2023-06-06 13:14:34 +0000
committerGitHub2023-06-06 13:14:34 +0000
commit78e869542022638af482c0dd85a07086a942907a (patch)
tree03723b6d429568307e6d17ceca1d01803121fe26
parent71688a387bb4435294c7f15502746210788dabda (diff)
Add support for Forth (#7256)
-rw-r--r--book/src/generated/lang-support.md1
-rw-r--r--languages.toml13
-rw-r--r--runtime/queries/forth/highlights.scm8
3 files changed, 22 insertions, 0 deletions
diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md
index 59fe310f..b8753d58 100644
--- a/book/src/generated/lang-support.md
+++ b/book/src/generated/lang-support.md
@@ -41,6 +41,7 @@
| erlang | ✓ | ✓ | | `erlang_ls` |
| esdl | ✓ | | | |
| fish | ✓ | ✓ | ✓ | |
+| forth | ✓ | | | |
| fortran | ✓ | | ✓ | `fortls` |
| gdscript | ✓ | ✓ | ✓ | |
| git-attributes | ✓ | | | |
diff --git a/languages.toml b/languages.toml
index 4930b067..219ea541 100644
--- a/languages.toml
+++ b/languages.toml
@@ -2592,3 +2592,16 @@ indent = { tab-width = 4, unit = " " }
[[grammar]]
name = "blueprint"
source = { git = "https://gitlab.com/gabmus/tree-sitter-blueprint", rev = "7f1a5df44861291d6951b6b2146a9fef4c226e14" }
+
+[[language]]
+name = "forth"
+scope = "source.forth"
+injection-regex = "forth"
+file-types = ["fs", "forth", "fth", "4th"]
+roots = []
+comment-token = "\\"
+indent = { tab-width = 3, unit = " " }
+
+[[grammar]]
+name = "forth"
+source = { git = "https://github.com/alexanderbrevig/tree-sitter-forth", rev = "c6fae50a17763af827604627c0fa9e4604aaac0b" }
diff --git a/runtime/queries/forth/highlights.scm b/runtime/queries/forth/highlights.scm
new file mode 100644
index 00000000..7be0d132
--- /dev/null
+++ b/runtime/queries/forth/highlights.scm
@@ -0,0 +1,8 @@
+([(start_definition)(end_definition)] @keyword)
+([(lparen) (rparen)] @punctuation.bracket)
+((stack_effect_sep) @punctuation)
+((number) @constant)
+((word) @function)
+((comment) @comment)
+([(core)] @type)
+([(operator)] @operator)