summaryrefslogtreecommitdiff
path: root/queries
diff options
context:
space:
mode:
authorMartin Pépin <kerl@wkerl.me>2022-09-01 19:36:23 +0200
committerStephan Seitz <stephan.seitz@fau.de>2022-09-05 14:48:58 -0700
commit82036f8db8d539653cb8a5ef5a6a1a9f7d735555 (patch)
treef0ea5f3fed49ad6acd6766d02657b687b6bd672f /queries
parent1a563fc68951f21db272d810c6892b077f64ad81 (diff)
Add support for menhir (OCaml parser generator)
Diffstat (limited to 'queries')
-rw-r--r--queries/menhir/highlights.scm29
-rw-r--r--queries/menhir/injections.scm1
2 files changed, 30 insertions, 0 deletions
diff --git a/queries/menhir/highlights.scm b/queries/menhir/highlights.scm
new file mode 100644
index 00000000..64789ee4
--- /dev/null
+++ b/queries/menhir/highlights.scm
@@ -0,0 +1,29 @@
+["%parameter" "%token" "%type" "%start" "%attribute" "%left" "%right" "%nonassoc" "%public" "%inline" "%prec"] @keyword
+["%on_error_reduce"] @exception
+
+["let"] @keyword.function
+
+[(equality_symbol) ":" "|" ";" ","] @punctuation.delimiter
+
+["=" "~" "_"] @operator
+(modifier) @operator
+
+["<" ">" "{" "}" "%{" "%}" "%%"] @punctuation.special
+
+["(" ")"] @punctuation.bracket
+
+(old_rule [(symbol)] @function)
+(new_rule [(lid)] @function)
+
+(precedence [(symbol)] @parameter)
+
+(funcall) @function.call
+
+; Not very accurant but does a decent job
+(uid) @constant
+
+(ocaml_type) @type
+(ocaml) @none
+
+[(comment) (line_comment) (ocaml_comment)] @comment
+(ERROR) @error
diff --git a/queries/menhir/injections.scm b/queries/menhir/injections.scm
new file mode 100644
index 00000000..7a31dd50
--- /dev/null
+++ b/queries/menhir/injections.scm
@@ -0,0 +1 @@
+(ocaml) @ocaml