diff --git a/lockfile.json b/lockfile.json index 74fb48cf9..89c924d06 100644 --- a/lockfile.json +++ b/lockfile.json @@ -336,7 +336,7 @@ "revision": "11559418d8de82a2313504dc5bec9983d17ea4e9" }, "ocamllex": { - "revision": "ac1d5957e719d49bd6acd27439b79843e4daf8ed" + "revision": "62118551bd9501b8253598b835cb4bef04b31e3d" }, "odin": { "revision": "d165dbee27617dab2653e38737d96ede1030d14f" diff --git a/queries/ocamllex/highlights.scm b/queries/ocamllex/highlights.scm index 513316159..060a57dc8 100644 --- a/queries/ocamllex/highlights.scm +++ b/queries/ocamllex/highlights.scm @@ -1,29 +1,41 @@ - -[(lexer_argument) (regexp_name) (any)] @type - -(lexer_entry_name) @function - -["as" "let" "and" "parse" "rule"] @keyword - -[(eof) (character)] @character -(string) @string +; Allow OCaml highlighter (ocaml) @none -(character_range "-" @operator) -(character_set "^" @operator) -(regexp_alternative ["|"] @operator) +; Regular expressions + +(regexp_name) @variable + +[(eof) (any)] @constant + +(character) @character + +(string) @string +(escape_sequence) @string.escape + +(character_set "^" @punctuation.special) +(character_range "-" @punctuation.delimiter) + (regexp_difference ["#"] @operator) -(regexp_option ["?"] @operator) -(regexp_repetition ["*"] @operator) -(regexp_strict_repetition ["+"] @operator) +(regexp_repetition ["?" "*" "+"] @operator) +(regexp_alternative ["|"] @operator) -(action ["{" "}"] @punctuation.special) -(character_set ["[" "]"] @punctuation.bracket) -(parenthesized_regexp ["(" ")"] @punctuation.bracket) +; Rules -["="] @punctuation.delimiter -(lexer_entry "|" @punctuation.delimiter) +(lexer_entry_name) @function +(lexer_argument) @parameter + +(lexer_entry ["=" "|"] @punctuation.delimiter) + +; keywords + +["and" "as" "let" "parse" "refill" "rule" "shortest"] @keyword + +; Punctuation + +["[" "]" "(" ")" "{" "}"] @punctuation.bracket + +; Misc (comment) @comment (ERROR) @error