2025-01-14 22:26:56 +08:00
|
|
|
[
|
2025-02-04 22:34:59 +08:00
|
|
|
(module)
|
|
|
|
(as)
|
|
|
|
(exposing)
|
|
|
|
(backslash)
|
|
|
|
] @keyword
|
2025-01-14 22:26:56 +08:00
|
|
|
|
2025-02-04 22:34:59 +08:00
|
|
|
(import) @keyword.control.import
|
|
|
|
|
|
|
|
[
|
|
|
|
"if"
|
|
|
|
"then"
|
|
|
|
"else"
|
|
|
|
(when)
|
|
|
|
(is)
|
|
|
|
] @keyword.control.conditional
|
|
|
|
|
|
|
|
[
|
|
|
|
(type)
|
|
|
|
(alias)
|
|
|
|
(infix)
|
|
|
|
(port)
|
|
|
|
"let"
|
|
|
|
"in"
|
|
|
|
] @keyword.storage.type
|
2025-01-14 22:26:56 +08:00
|
|
|
|
2025-02-04 22:34:59 +08:00
|
|
|
(dot) @operator
|
2025-01-14 22:26:56 +08:00
|
|
|
|
2025-02-04 22:34:59 +08:00
|
|
|
[
|
|
|
|
(colon)
|
|
|
|
(arrow)
|
|
|
|
(eq)
|
|
|
|
(operator_identifier)
|
|
|
|
"|"
|
|
|
|
] @keyword.operator
|
2025-01-14 22:26:56 +08:00
|
|
|
|
|
|
|
[
|
|
|
|
"("
|
|
|
|
")"
|
|
|
|
"["
|
|
|
|
"]"
|
|
|
|
"{"
|
|
|
|
"}"
|
|
|
|
] @punctuation.bracket
|
|
|
|
|
|
|
|
"," @punctuation.delimiter
|
|
|
|
|
2025-02-04 22:34:59 +08:00
|
|
|
; modules
|
2025-01-14 22:26:56 +08:00
|
|
|
|
2025-02-04 22:34:59 +08:00
|
|
|
(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)
|
2025-01-14 22:26:56 +08:00
|
|
|
|
2025-02-04 22:34:59 +08:00
|
|
|
; functions
|
2025-01-14 22:26:56 +08:00
|
|
|
|
2025-02-04 22:34:59 +08:00
|
|
|
(type_annotation(lower_case_identifier) @function)
|
|
|
|
(port_annotation(lower_case_identifier) @function)
|
|
|
|
(file (value_declaration (function_declaration_left(lower_case_identifier) @function)))
|
|
|
|
|
|
|
|
; types
|
2025-01-14 22:26:56 +08:00
|
|
|
|
2025-02-04 22:34:59 +08:00
|
|
|
(field name: (lower_case_identifier) @variable.other.member)
|
|
|
|
(field_type name: (lower_case_identifier) @variable.other.member)
|
|
|
|
(field_access_expr(lower_case_identifier) @variable)
|
2025-01-14 22:26:56 +08:00
|
|
|
|
|
|
|
(type_declaration(upper_case_identifier) @type)
|
2025-02-04 22:34:59 +08:00
|
|
|
(type_declaration typeName: (lower_type_name) @type.parameter)
|
|
|
|
|
2025-01-14 22:26:56 +08:00
|
|
|
(type_alias_declaration name: (upper_case_identifier) @type)
|
2025-02-04 22:34:59 +08:00
|
|
|
(type_alias_declaration typeVariable: (lower_type_name) @type.parameter)
|
|
|
|
|
|
|
|
(type_ref(upper_case_qid) @type)
|
|
|
|
(type_ref(upper_case_qid(upper_case_identifier) @namespace (dot) (upper_case_identifier) @type))
|
|
|
|
|
|
|
|
(type_variable(lower_case_identifier) @type.parameter)
|
|
|
|
|
|
|
|
; variables
|
|
|
|
|
|
|
|
(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)
|
2025-01-14 22:26:56 +08:00
|
|
|
|
2025-02-04 22:34:59 +08:00
|
|
|
(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)
|
2025-01-14 22:26:56 +08:00
|
|
|
|
2025-02-04 22:34:59 +08:00
|
|
|
(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))
|
2025-01-14 22:26:56 +08:00
|
|
|
|
|
|
|
; comments
|
2025-02-04 22:34:59 +08:00
|
|
|
|
2025-01-14 22:26:56 +08:00
|
|
|
(line_comment) @comment
|
|
|
|
(block_comment) @comment
|
|
|
|
|
2025-02-04 22:34:59 +08:00
|
|
|
; numbers
|
|
|
|
|
|
|
|
(number_constant_expr) @constant.numeric
|
|
|
|
|
2025-01-14 22:26:56 +08:00
|
|
|
; strings
|
|
|
|
|
2025-02-04 22:34:59 +08:00
|
|
|
(string_escape) @constant.character.escape
|
2025-01-14 22:26:56 +08:00
|
|
|
|
2025-02-04 22:34:59 +08:00
|
|
|
(string_constant_expr) @string
|
|
|
|
(char_constant_expr) @constant.character
|