mirror of https://github.com/helix-editor/helix
Update highlights.scm for Gren language (#12769)
parent
1258111394
commit
ee33a84489
|
@ -1,34 +1,38 @@
|
||||||
; Keywords
|
|
||||||
[
|
[
|
||||||
"if"
|
(module)
|
||||||
"then"
|
(as)
|
||||||
"else"
|
(exposing)
|
||||||
"let"
|
(backslash)
|
||||||
"in"
|
] @keyword
|
||||||
] @keyword.control
|
|
||||||
(when) @keyword.control
|
|
||||||
(is) @keyword.control
|
|
||||||
|
|
||||||
(colon) @keyword.operator
|
(import) @keyword.control.import
|
||||||
(backslash) @keyword
|
|
||||||
(as) @keyword
|
|
||||||
(port) @keyword
|
|
||||||
(exposing) @keyword
|
|
||||||
(alias) @keyword
|
|
||||||
(infix) @keyword
|
|
||||||
|
|
||||||
(arrow) @keyword.operator
|
[
|
||||||
(dot) @keyword.operator
|
"if"
|
||||||
|
"then"
|
||||||
|
"else"
|
||||||
|
(when)
|
||||||
|
(is)
|
||||||
|
] @keyword.control.conditional
|
||||||
|
|
||||||
(type_annotation(lower_case_identifier) @function)
|
[
|
||||||
(port_annotation(lower_case_identifier) @function)
|
(type)
|
||||||
(file (value_declaration (function_declaration_left(lower_case_identifier) @function)))
|
(alias)
|
||||||
|
(infix)
|
||||||
|
(port)
|
||||||
|
"let"
|
||||||
|
"in"
|
||||||
|
] @keyword.storage.type
|
||||||
|
|
||||||
(field name: (lower_case_identifier) @attribute)
|
(dot) @operator
|
||||||
(field_access_expr(lower_case_identifier) @attribute)
|
|
||||||
|
|
||||||
(operator_identifier) @keyword.operator
|
[
|
||||||
(eq) @keyword.operator.assignment
|
(colon)
|
||||||
|
(arrow)
|
||||||
|
(eq)
|
||||||
|
(operator_identifier)
|
||||||
|
"|"
|
||||||
|
] @keyword.operator
|
||||||
|
|
||||||
[
|
[
|
||||||
"("
|
"("
|
||||||
|
@ -39,43 +43,69 @@
|
||||||
"}"
|
"}"
|
||||||
] @punctuation.bracket
|
] @punctuation.bracket
|
||||||
|
|
||||||
"|" @keyword
|
|
||||||
"," @punctuation.delimiter
|
"," @punctuation.delimiter
|
||||||
|
|
||||||
[
|
; modules
|
||||||
"|>"
|
|
||||||
] @keyword
|
|
||||||
|
|
||||||
|
(module_declaration(upper_case_qid) @namespace)
|
||||||
|
(import_clause(upper_case_qid) @namespace)
|
||||||
|
(import_clause(as_clause(upper_case_identifier) @namespace))
|
||||||
|
(exposing_list(exposed_type(upper_case_identifier) @type))
|
||||||
|
(exposing_list(exposed_value) @variable)
|
||||||
|
|
||||||
(import) @keyword.control.import
|
; functions
|
||||||
(module) @keyword.other
|
|
||||||
|
|
||||||
(number_constant_expr) @constant.numeric
|
(type_annotation(lower_case_identifier) @function)
|
||||||
|
(port_annotation(lower_case_identifier) @function)
|
||||||
|
(file (value_declaration (function_declaration_left(lower_case_identifier) @function)))
|
||||||
|
|
||||||
(type) @type
|
; types
|
||||||
|
|
||||||
|
(field name: (lower_case_identifier) @variable.other.member)
|
||||||
|
(field_type name: (lower_case_identifier) @variable.other.member)
|
||||||
|
(field_access_expr(lower_case_identifier) @variable)
|
||||||
|
|
||||||
(type_declaration(upper_case_identifier) @type)
|
(type_declaration(upper_case_identifier) @type)
|
||||||
(type_ref) @type
|
(type_declaration typeName: (lower_type_name) @type.parameter)
|
||||||
|
|
||||||
(type_alias_declaration name: (upper_case_identifier) @type)
|
(type_alias_declaration name: (upper_case_identifier) @type)
|
||||||
|
(type_alias_declaration typeVariable: (lower_type_name) @type.parameter)
|
||||||
|
|
||||||
(union_pattern constructor: (upper_case_qid (upper_case_identifier) @label (dot) (upper_case_identifier) @variable.other.member))
|
(type_ref(upper_case_qid) @type)
|
||||||
(union_pattern constructor: (upper_case_qid (upper_case_identifier) @variable.other.member))
|
(type_ref(upper_case_qid(upper_case_identifier) @namespace (dot) (upper_case_identifier) @type))
|
||||||
|
|
||||||
(union_variant(upper_case_identifier) @variable.other.member)
|
(type_variable(lower_case_identifier) @type.parameter)
|
||||||
(value_expr name: (value_qid (upper_case_identifier) @label))
|
|
||||||
(value_expr (upper_case_qid (upper_case_identifier) @label (dot) (upper_case_identifier) @variable.other.member))
|
; variables
|
||||||
(value_expr(upper_case_qid(upper_case_identifier)) @variable.other.member)
|
|
||||||
|
(union_pattern constructor: (upper_case_qid (upper_case_identifier) @namespace (dot) (upper_case_identifier) @constructor))
|
||||||
|
(union_pattern constructor: (upper_case_qid (upper_case_identifier) @constructor))
|
||||||
|
|
||||||
|
(union_variant(upper_case_identifier) @constructor)
|
||||||
|
|
||||||
|
(value_expr name: (value_qid (upper_case_identifier) @namespace))
|
||||||
|
(value_expr(upper_case_qid(upper_case_identifier) @namespace (dot) (upper_case_identifier) @constructor))
|
||||||
|
(value_expr(upper_case_qid(upper_case_identifier)) @constructor)
|
||||||
|
|
||||||
|
(value_expr(value_qid(upper_case_identifier) @namespace (dot) (lower_case_identifier) @variable))
|
||||||
|
(value_expr(value_qid(lower_case_identifier) @variable))
|
||||||
|
|
||||||
|
(let_in_expr(value_declaration(function_declaration_left(lower_case_identifier) @variable)))
|
||||||
|
|
||||||
|
(function_declaration_left(lower_pattern(lower_case_identifier) @variable.parameter))
|
||||||
|
|
||||||
; comments
|
; comments
|
||||||
|
|
||||||
(line_comment) @comment
|
(line_comment) @comment
|
||||||
(block_comment) @comment
|
(block_comment) @comment
|
||||||
|
|
||||||
|
; numbers
|
||||||
|
|
||||||
|
(number_constant_expr) @constant.numeric
|
||||||
|
|
||||||
; strings
|
; strings
|
||||||
|
|
||||||
(string_escape) @constant.character.escape
|
(string_escape) @constant.character.escape
|
||||||
|
|
||||||
(open_quote) @string
|
(string_constant_expr) @string
|
||||||
(close_quote) @string
|
(char_constant_expr) @constant.character
|
||||||
(regular_string_part) @string
|
|
||||||
|
|
||||||
(open_char) @constant.character
|
|
||||||
(close_char) @constant.character
|
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
(value_declaration (function_declaration_left (lower_case_identifier) @name)) @definition.function
|
|
||||||
|
|
||||||
(function_call_expr (value_expr (value_qid) @name)) @reference.function
|
|
||||||
(exposed_value (lower_case_identifier) @name) @reference.function
|
|
||||||
(type_annotation ((lower_case_identifier) @name) (colon)) @reference.function
|
|
||||||
|
|
||||||
(type_declaration ((upper_case_identifier) @name) ) @definition.type
|
|
||||||
|
|
||||||
(type_ref (upper_case_qid (upper_case_identifier) @name)) @reference.type
|
|
||||||
(exposed_type (upper_case_identifier) @name) @reference.type
|
|
||||||
|
|
||||||
(type_declaration (union_variant (upper_case_identifier) @name)) @definition.union
|
|
||||||
|
|
||||||
(value_expr (upper_case_qid (upper_case_identifier) @name)) @reference.union
|
|
||||||
|
|
||||||
|
|
||||||
(module_declaration
|
|
||||||
(upper_case_qid (upper_case_identifier)) @name
|
|
||||||
) @definition.module
|
|
Loading…
Reference in New Issue