2023-08-08 20:50:49 +02:00
|
|
|
;; Primitives
|
|
|
|
(comment) @comment
|
|
|
|
(nat) @constant.numeric
|
|
|
|
(unit) @constant.builtin
|
|
|
|
(literal_char) @constant.character
|
|
|
|
(literal_text) @string
|
|
|
|
(literal_boolean) @constant.builtin.boolean
|
|
|
|
|
|
|
|
;; Keywords
|
|
|
|
[
|
|
|
|
(kw_forall)
|
|
|
|
(type_kw)
|
|
|
|
(kw_equals)
|
|
|
|
(do)
|
2023-09-17 20:23:19 +02:00
|
|
|
(ability)
|
|
|
|
(where)
|
2023-08-08 20:50:49 +02:00
|
|
|
] @keyword
|
|
|
|
|
|
|
|
(kw_let) @keyword.function
|
|
|
|
(type_kw) @keyword.storage.type
|
|
|
|
(unique) @keyword.storage.modifier
|
2023-09-17 20:23:19 +02:00
|
|
|
(structural) @keyword.storage.modifier
|
2023-08-08 20:50:49 +02:00
|
|
|
("use") @keyword.control.import
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
(type_constructor)
|
|
|
|
] @constructor
|
|
|
|
|
|
|
|
[
|
|
|
|
(operator)
|
|
|
|
(pipe)
|
|
|
|
(arrow_symbol)
|
|
|
|
(">")
|
|
|
|
(or)
|
2023-09-17 20:23:19 +02:00
|
|
|
(and)
|
2023-08-08 20:50:49 +02:00
|
|
|
(bang)
|
|
|
|
] @operator
|
|
|
|
|
|
|
|
[
|
|
|
|
"if"
|
|
|
|
"else"
|
|
|
|
"then"
|
|
|
|
(match)
|
|
|
|
(with)
|
|
|
|
(cases)
|
|
|
|
] @keyword.control.conditional
|
|
|
|
|
|
|
|
(blank_pattern) @variable.builtin
|
|
|
|
|
|
|
|
;; Types
|
2024-02-04 02:10:20 +01:00
|
|
|
(record_field name: (wordy_id) @variable.other.member type: (_) @type)
|
2023-09-17 20:23:19 +02:00
|
|
|
(type_constructor (type_name (wordy_id) @constructor))
|
|
|
|
(ability_declaration type_name: (wordy_id) @type type_arg: (wordy_id) @variable.parameter)
|
|
|
|
(effect (wordy_id) @special) ;; NOTE: an effect is just like a type, but in signature we special case it
|
|
|
|
|
|
|
|
;; Namespaces
|
|
|
|
(path) @namespace
|
|
|
|
(namespace) @namespace
|
|
|
|
|
|
|
|
;; Terms
|
|
|
|
(type_signature term_name: (path)? @variable term_name: (wordy_id) @variable)
|
|
|
|
(type_signature (wordy_id) @type)
|
2024-01-25 06:12:17 +01:00
|
|
|
(type_signature (term_type(delayed(wordy_id))) @type)
|
2023-09-17 20:23:19 +02:00
|
|
|
|
|
|
|
(term_definition param: (wordy_id) @variable.parameter)
|
2023-08-08 20:50:49 +02:00
|
|
|
|
2023-09-17 20:23:19 +02:00
|
|
|
(function_application function_name: (path)? function_name: (wordy_id) @function)
|
2023-08-08 20:50:49 +02:00
|
|
|
|
|
|
|
;; Punctuation
|
|
|
|
[
|
|
|
|
(type_signature_colon)
|
|
|
|
":"
|
|
|
|
] @punctuation.delimiter
|
|
|
|
|
|
|
|
[
|
|
|
|
"("
|
|
|
|
")"
|
|
|
|
"{"
|
|
|
|
"}"
|
|
|
|
"["
|
|
|
|
"]"
|
|
|
|
] @punctuation.bracket
|
|
|
|
|
2023-09-17 20:23:19 +02:00
|
|
|
(test_watch_expression (wordy_id) @keyword.directive)
|