2023-06-18 14:17:38 +08:00
|
|
|
; Allow OCaml highlighter
|
2022-04-14 12:01:23 +08:00
|
|
|
|
2023-06-18 14:17:38 +08:00
|
|
|
(ocaml) @none
|
2022-04-14 12:01:23 +08:00
|
|
|
|
2023-06-18 14:17:38 +08:00
|
|
|
; Regular expressions
|
|
|
|
|
|
|
|
(regexp_name) @variable
|
|
|
|
|
|
|
|
[(eof) (any)] @constant
|
2022-04-14 12:01:23 +08:00
|
|
|
|
2023-06-18 14:17:38 +08:00
|
|
|
(character) @character
|
2022-04-14 12:01:23 +08:00
|
|
|
|
|
|
|
(string) @string
|
2023-06-18 14:17:38 +08:00
|
|
|
(escape_sequence) @string.escape
|
2022-04-14 12:01:23 +08:00
|
|
|
|
2023-06-18 14:17:38 +08:00
|
|
|
(character_set "^" @punctuation.special)
|
|
|
|
(character_range "-" @punctuation.delimiter)
|
2022-04-14 12:01:23 +08:00
|
|
|
|
|
|
|
(regexp_difference ["#"] @operator)
|
2023-06-18 14:17:38 +08:00
|
|
|
(regexp_repetition ["?" "*" "+"] @operator)
|
|
|
|
(regexp_alternative ["|"] @operator)
|
|
|
|
|
|
|
|
; Rules
|
|
|
|
|
|
|
|
(lexer_entry_name) @function
|
|
|
|
(lexer_argument) @parameter
|
|
|
|
|
|
|
|
(lexer_entry ["=" "|"] @punctuation.delimiter)
|
|
|
|
|
|
|
|
; keywords
|
|
|
|
|
|
|
|
["and" "as" "let" "parse" "refill" "rule" "shortest"] @keyword
|
|
|
|
|
|
|
|
; Punctuation
|
2022-04-14 12:01:23 +08:00
|
|
|
|
2023-06-18 14:17:38 +08:00
|
|
|
["[" "]" "(" ")" "{" "}"] @punctuation.bracket
|
2022-04-14 12:01:23 +08:00
|
|
|
|
2023-06-18 14:17:38 +08:00
|
|
|
; Misc
|
2022-04-14 12:01:23 +08:00
|
|
|
|
|
|
|
(comment) @comment
|
|
|
|
(ERROR) @error
|