diff --git a/extensions/ocaml/extension.toml b/extensions/ocaml/extension.toml index 99f83d126307c20c9f61a7285706b602ce346fcb..0523ba83b6b8e87dd203884d6f2508b6cbbe9cb2 100644 --- a/extensions/ocaml/extension.toml +++ b/extensions/ocaml/extension.toml @@ -19,3 +19,7 @@ path = "grammars/ocaml" repository = "https://github.com/tree-sitter/tree-sitter-ocaml" commit = "0b12614ded3ec7ed7ab7933a9ba4f695ba4c342e" path = "grammars/interface" + +[grammars.dune] +repository = "https://github.com/WHForks/tree-sitter-dune" +commit = "b3f7882e1b9a1d8811011bf6f0de1c74c9c93949" diff --git a/extensions/ocaml/languages/dune/config.toml b/extensions/ocaml/languages/dune/config.toml new file mode 100644 index 0000000000000000000000000000000000000000..332e3f112ea5db52a5328882d3921c14e8efdd73 --- /dev/null +++ b/extensions/ocaml/languages/dune/config.toml @@ -0,0 +1,8 @@ +name = "Dune" +grammar = "dune" +path_suffixes = ["dune", "dune-project"] +brackets = [ + { start = "(", end = ")", close = true, newline = true }, + { start = "\"", end = "\"", close = true, newline = false, not_in = ["string"] } +] +tab_size = 2 diff --git a/extensions/ocaml/languages/dune/highlights.scm b/extensions/ocaml/languages/dune/highlights.scm new file mode 100644 index 0000000000000000000000000000000000000000..e7a21cd2c51c038962b12a2358e5aeddf4cd482d --- /dev/null +++ b/extensions/ocaml/languages/dune/highlights.scm @@ -0,0 +1,5 @@ +(stanza_name) @function +(field_name) @property +(quoted_string) @string +(multiline_string) @string +(action_name) @keyword diff --git a/extensions/ocaml/languages/dune/injections.scm b/extensions/ocaml/languages/dune/injections.scm new file mode 100644 index 0000000000000000000000000000000000000000..441998290e76dfd76e6be1b509a2c903643dca22 --- /dev/null +++ b/extensions/ocaml/languages/dune/injections.scm @@ -0,0 +1,2 @@ +((ocaml_syntax) @injection.content + (#set! injection.language "ocaml"))