mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat: add ocamllex parser and highlights
This commit is contained in:
parent
37b011b679
commit
f1c272676b
2 changed files with 35 additions and 0 deletions
|
|
@ -145,6 +145,14 @@ list.ocaml_interface = {
|
|||
filetype = 'ocamlinterface'
|
||||
}
|
||||
|
||||
list.ocamllex = {
|
||||
install_info = {
|
||||
url = "https://github.com/atom-ocaml/tree-sitter-ocamllex",
|
||||
files = { "src/parser.c", "src/scanner.cc" },
|
||||
},
|
||||
maintainers = {'@undu'},
|
||||
}
|
||||
|
||||
list.swift = {
|
||||
install_info = {
|
||||
url = "https://github.com/tree-sitter/tree-sitter-swift",
|
||||
|
|
|
|||
27
queries/ocamllex/highlights.scm
Normal file
27
queries/ocamllex/highlights.scm
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
|
||||
[(lexer_argument) (regexp_name) (any)] @type
|
||||
|
||||
(lexer_entry_name) @function
|
||||
|
||||
["as" "let" "parse" "rule"] @keyword
|
||||
|
||||
[(eof) (character)] @character
|
||||
(string) @string
|
||||
|
||||
(character_range "-" @operator)
|
||||
(character_set "^" @operator)
|
||||
(regexp_alternative ["|"] @operator)
|
||||
(regexp_difference ["#"] @operator)
|
||||
(regexp_option ["?"] @operator)
|
||||
(regexp_repetition ["*"] @operator)
|
||||
(regexp_strict_repetition ["+"] @operator)
|
||||
|
||||
(action ["{" "}"] @punctuation.special) @embedded
|
||||
(character_set ["[" "]"] @punctuation.bracket)
|
||||
(parenthesized_regexp ["(" ")"] @punctuation.bracket)
|
||||
|
||||
["="] @punctuation.delimiter
|
||||
(lexer_entry "|" @punctuation.delimiter)
|
||||
|
||||
(comment) @comment
|
||||
(ERROR) @error
|
||||
Loading…
Add table
Add a link
Reference in a new issue