mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-23 01:46:18 +04:00
2d9e336f64
* feat: Add `Ohm` language support Hope this commit makes it into release :) * Update runtime/queries/ohm/highlights.scm Co-authored-by: Michael Davis <mcarsondavis@gmail.com> * chore: final newline --------- Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
123 lines
1.7 KiB
Scheme
123 lines
1.7 KiB
Scheme
; See: https://docs.helix-editor.com/master/themes.html#syntax-highlighting
|
|
|
|
; attribute
|
|
; ---------
|
|
|
|
(case_name) @attribute
|
|
|
|
; comment.line
|
|
; ------------
|
|
|
|
[
|
|
(singleline_comment)
|
|
(rule_descr)
|
|
] @comment.line
|
|
|
|
; comment.block
|
|
; -------------
|
|
|
|
(multiline_comment) @comment.block
|
|
|
|
; function.method
|
|
; ---------------
|
|
|
|
(rule
|
|
name: (identifier) @function.method)
|
|
|
|
; function.builtin
|
|
; ----------------
|
|
|
|
; Lexical
|
|
((identifier) @function.builtin
|
|
(#any-of? @function.builtin
|
|
"any"
|
|
"alnum"
|
|
"end"
|
|
"digit" "hexDigit"
|
|
"letter"
|
|
"space"
|
|
"lower" "upper" "caseInsensitive"
|
|
"listOf" "nonemptyListOf" "emptyListOf"
|
|
"applySyntactic")
|
|
(#is-not? local))
|
|
|
|
; Syntactic
|
|
((identifier) @function.builtin
|
|
(#any-of? @function.builtin "ListOf" "NonemptyListOf" "EmptyListOf")
|
|
(#is-not? local))
|
|
|
|
; function.method (continuing)
|
|
; ---------------
|
|
|
|
(term
|
|
base: (identifier) @function.method)
|
|
|
|
; string.special
|
|
; --------------
|
|
|
|
(escape_char) @constant.character.escape
|
|
|
|
; string
|
|
; ------
|
|
|
|
[
|
|
(terminal_string)
|
|
(one_char_terminal)
|
|
] @string
|
|
|
|
; type
|
|
; ----
|
|
|
|
(super_grammar
|
|
name: (identifier) @type)
|
|
|
|
(grammar
|
|
name: (identifier) @type)
|
|
|
|
; operator
|
|
; --------
|
|
|
|
[
|
|
; "=" ":=" "+="
|
|
(define) (override) (extend)
|
|
|
|
; "&" "~"
|
|
(lookahead) (negative_lookahead)
|
|
|
|
; "#"
|
|
(lexification)
|
|
|
|
; "*" "+" "?"
|
|
(zero_or_more) (one_or_more) (zero_or_one)
|
|
|
|
; "..."
|
|
(super_splice)
|
|
|
|
"<:" ".." "|"
|
|
] @operator
|
|
|
|
; punctuation.bracket
|
|
; -------------------
|
|
|
|
[
|
|
"<"
|
|
">"
|
|
"{"
|
|
"}"
|
|
] @punctuation.bracket
|
|
|
|
(alt
|
|
"(" @punctuation.bracket
|
|
")" @punctuation.bracket)
|
|
|
|
; punctuation.delimiter
|
|
; ---------------------
|
|
|
|
"," @punctuation.delimiter
|
|
|
|
; variable.parameter
|
|
; ------------------
|
|
|
|
(formals
|
|
(identifier) @variable.parameter)
|