chore: update ocamllex

* Update parsers: ocamllex

Update its highlight to make it compatible with the new parser

* highlights(ocamllex): follow newest changes from upstream

The upstream grammar added highlights in the latest version, change our
highlight so they reflect better the intention of the grammar's author
This commit is contained in:
Pau Ruiz Safont 2023-05-30 05:13:17 +01:00 committed by GitHub
parent 6de5ceba03
commit 06aa932bb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 21 deletions

View file

@ -336,7 +336,7 @@
"revision": "11559418d8de82a2313504dc5bec9983d17ea4e9"
},
"ocamllex": {
"revision": "ac1d5957e719d49bd6acd27439b79843e4daf8ed"
"revision": "62118551bd9501b8253598b835cb4bef04b31e3d"
},
"odin": {
"revision": "d165dbee27617dab2653e38737d96ede1030d14f"

View file

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