Add support for menhir (OCaml parser generator)

This commit is contained in:
Martin Pépin 2022-09-01 19:36:23 +02:00 committed by Stephan Seitz
parent 1a563fc689
commit 82036f8db8
4 changed files with 42 additions and 0 deletions

View file

@ -227,6 +227,9 @@
"ocamllex": {
"revision": "ac1d5957e719d49bd6acd27439b79843e4daf8ed"
},
"menhir": {
"revision": "db7953acb0d5551f207373c81fa07a57d7b085cb"
},
"org": {
"revision": "698bb1a34331e68f83fc24bdd1b6f97016bb30de"
},

View file

@ -471,6 +471,15 @@ list.ocamllex = {
maintainers = { "@undu" },
}
list.menhir = {
install_info = {
url = "https://github.com/Kerl13/tree-sitter-menhir",
files = { "src/parser.c", "src/scanner.cc" },
},
maintainers = { "@Kerl13" },
filetype = "menhir",
}
list.org = {
install_info = {
url = "https://github.com/milisims/tree-sitter-org",

View file

@ -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

View file

@ -0,0 +1 @@
(ocaml) @ocaml