diff options
| author | Andrew Helwer <ahelwer@protonmail.com> | 2021-08-29 20:26:37 -0700 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2021-08-30 07:35:12 +0200 |
| commit | 2d1e142451d4032235627d4429f16a739b1d679c (patch) | |
| tree | 11e894e0929006954fb0481083518de61d6887d7 | |
| parent | 1f769e9b081f2fe6c573e933dc2c0af64b8e6855 (diff) | |
Updated highlight queries for tlaplus
| -rw-r--r-- | queries/tlaplus/highlights.scm | 76 |
1 files changed, 47 insertions, 29 deletions
diff --git a/queries/tlaplus/highlights.scm b/queries/tlaplus/highlights.scm index 92868e45..f5dd93ac 100644 --- a/queries/tlaplus/highlights.scm +++ b/queries/tlaplus/highlights.scm @@ -66,7 +66,7 @@ (case_box) (case_arrow) (label_as) -] @keyword +] @number [ (def_eq) (maps_to) @@ -74,17 +74,49 @@ ] @keyword.function ; Literals -(number) @number +(nat_number) @number +(real_number) @float +(binary_number (format) @string.special) +(octal_number (format) @string.special) +(hex_number (format) @string.special) +(binary_number (value) @number) +(octal_number (value) @number) +(hex_number (value) @number) (string) @string +(escape_char) @string.escape (boolean) @boolean (primitive_value_set) @type ; Comments (comment) @comment (block_comment) @comment -(unit (single_line) @comment) +(single_line) @comment (extramodular_text) @text +; Punctuation and Delimiters +[ + (langle_bracket) + (rangle_bracket) + (rangle_bracket_sub) + "{" + "}" + "[" + "]" + "]_" + "(" + ")" +] @punctuation.bracket +[ + "," + "." + ":" + "!" +] @punctuation.delimiter +(bullet_conj) @punctuation.special +(bullet_disj) @punctuation.special +(prev_func_val) @punctuation.special +(placeholder) @punctuation.special + ; Namespaces (module name: (identifier) @namespace) (extends (identifier_ref) @namespace) @@ -94,11 +126,17 @@ ; Constants, Variables, and Operators (variable_declaration (identifier) @variable) (constant_declaration (identifier) @constant) +(constant_declaration (operator_declaration name: (_) @constant)) +(recursive_declaration (identifier) @function.macro) +(recursive_declaration (operator_declaration name: (_) @function.macro)) (operator_definition name: (_) @function.macro) (function_definition name: (identifier) @function) (bound_prefix_op symbol: (_) @operator) +(bound_nonfix_op (prefix_op_symbol) @operator) (bound_infix_op symbol: (_) @operator) +(bound_nonfix_op (infix_op_symbol) @operator) (bound_postfix_op symbol: (_) @operator) +(bound_nonfix_op (postfix_op_symbol) @operator) ; Parameters (operator_definition parameter: (identifier) @parameter) @@ -109,32 +147,12 @@ (function_definition (quantifier_bound (tuple_of_identifiers (identifier) @parameter))) (lambda (identifier) @parameter) -; Punctuation and Delimiters -[ - (langle_bracket) - (rangle_bracket) - (rangle_bracket_sub) - "{" - "}" - "[" - "]" - "]_" - "(" - ")" -] @punctuation.bracket -[ - "," - ":" - "<" - ">" - "!" -] @punctuation.delimiter -(bullet_conj) @punctuation.special -(bullet_disj) @punctuation.special -(prev_func_val) @punctuation.special - ; Proofs +(proof_step_id "<" @punctuation.bracket) (proof_step_id (level) @number) -(proof_step_id (name) @symbol) +(proof_step_id (name) @constant) +(proof_step_id ">" @punctuation.bracket) +(proof_step_ref "<" @punctuation.bracket) (proof_step_ref (level) @number) -(proof_step_ref (name) @symbol) +(proof_step_ref (name) @constant) +(proof_step_ref ">" @punctuation.bracket) |
