aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/forth
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/queries/forth')
-rw-r--r--runtime/queries/forth/folds.scm1
-rw-r--r--runtime/queries/forth/highlights.scm19
-rw-r--r--runtime/queries/forth/indents.scm3
-rw-r--r--runtime/queries/forth/injections.scm2
-rw-r--r--runtime/queries/forth/locals.scm3
5 files changed, 28 insertions, 0 deletions
diff --git a/runtime/queries/forth/folds.scm b/runtime/queries/forth/folds.scm
new file mode 100644
index 000000000..443abb30d
--- /dev/null
+++ b/runtime/queries/forth/folds.scm
@@ -0,0 +1 @@
+(word_definition) @fold
diff --git a/runtime/queries/forth/highlights.scm b/runtime/queries/forth/highlights.scm
new file mode 100644
index 000000000..1e7207597
--- /dev/null
+++ b/runtime/queries/forth/highlights.scm
@@ -0,0 +1,19 @@
+(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 @spell
diff --git a/runtime/queries/forth/indents.scm b/runtime/queries/forth/indents.scm
new file mode 100644
index 000000000..067755433
--- /dev/null
+++ b/runtime/queries/forth/indents.scm
@@ -0,0 +1,3 @@
+(word_definition) @indent.begin
+
+(end_definition) @indent.end @indent.branch
diff --git a/runtime/queries/forth/injections.scm b/runtime/queries/forth/injections.scm
new file mode 100644
index 000000000..2f0e58eb6
--- /dev/null
+++ b/runtime/queries/forth/injections.scm
@@ -0,0 +1,2 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))
diff --git a/runtime/queries/forth/locals.scm b/runtime/queries/forth/locals.scm
new file mode 100644
index 000000000..d91d3aa98
--- /dev/null
+++ b/runtime/queries/forth/locals.scm
@@ -0,0 +1,3 @@
+(word) @local.reference
+
+(word_definition) @local.scope