aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/ebnf/highlights.scm
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/queries/ebnf/highlights.scm')
-rw-r--r--runtime/queries/ebnf/highlights.scm42
1 files changed, 42 insertions, 0 deletions
diff --git a/runtime/queries/ebnf/highlights.scm b/runtime/queries/ebnf/highlights.scm
new file mode 100644
index 000000000..4254d04dd
--- /dev/null
+++ b/runtime/queries/ebnf/highlights.scm
@@ -0,0 +1,42 @@
+; Simple tokens ;;;;
+(terminal) @string
+
+(special_sequence) @string.special
+
+(integer) @number
+
+(comment) @comment @spell
+
+; Identifiers ;;;;
+; Allow different highlighting for specific casings
+((identifier) @type
+ (#lua-match? @type "^%u"))
+
+((identifier) @string.special.symbol
+ (#lua-match? @string.special.symbol "^%l"))
+
+((identifier) @constant
+ (#lua-match? @constant "^%u[%u%d_]+$"))
+
+; Punctuation ;;;;
+[
+ ";"
+ ","
+] @punctuation.delimiter
+
+[
+ "|"
+ "*"
+ "-"
+] @operator
+
+"=" @keyword.operator
+
+[
+ "("
+ ")"
+ "["
+ "]"
+ "{"
+ "}"
+] @punctuation.bracket