From 357334f681351139330c6c0c6a8b9d136e82e1f5 Mon Sep 17 00:00:00 2001 From: Alexander Brevig Date: Tue, 6 Jun 2023 15:14:34 +0200 Subject: [PATCH] Add support for Forth (#7256) --- book/src/generated/lang-support.md | 1 + languages.toml | 13 +++++++++++++ runtime/queries/forth/highlights.scm | 8 ++++++++ 3 files changed, 22 insertions(+) create mode 100644 runtime/queries/forth/highlights.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 59fe310f0b12..b8753d587b03 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 4930b067e782..219ea541f192 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 000000000000..7be0d132e52b --- /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)