|
74 | 74 | (module_path_root_only "::" @punctuation.separator) |
75 | 75 | (module_path_relative "::" @punctuation.separator) |
76 | 76 | (module_path_relative segment: (identifier) @module.special) |
77 | | - (module_path_absolute "::" @punctuation.separator |
78 | | - segment: (identifier) @module.special) |
| 77 | + (module_path_absolute |
| 78 | + "::" @punctuation.separator |
| 79 | + segment: (identifier) @module.special) |
79 | 80 |
|
80 | 81 | (import_statement "import" @keyword) |
81 | 82 | (import_statement [ "[" "]" ] @punctuation.bracket) |
|
90 | 91 | ;; Annotations and Constraints (Note property => label) |
91 | 92 | ;; ------------------------------------------------------------------- |
92 | 93 |
|
93 | | - (annotation_property |
94 | | - "@" @label |
95 | | - name: (identifier_reference) @label) |
| 94 | + (annotation_property "@" @label name: (identifier_reference) @label) |
96 | 95 |
|
97 | 96 | (annotation_property value: (value (identifier_reference) @type)) |
98 | 97 |
|
|
103 | 102 |
|
104 | 103 | (constraint_environment "with" @keyword) |
105 | 104 |
|
106 | | - (function_def |
107 | | - (function_signature name: (identifier) @function.definition)) |
| 105 | + (function_def (function_signature name: (identifier) @function.definition)) |
108 | 106 |
|
109 | 107 | (function_signature "def" @keyword) |
110 | 108 | (function_signature target: (_) @type) |
|
113 | 111 | (function_parameter name: (identifier) @variable.parameter) |
114 | 112 | (function_parameter target: (_) @type) |
115 | 113 |
|
116 | | - (function_cardinality_expression (sequence_ordering) @keyword) |
117 | | - (function_cardinality_expression (sequence_uniqueness) @keyword) |
118 | | - (function_cardinality_expression [ "{" "}" ] @punctuation.bracket) |
| 114 | + (cardinality_reference_expression (sequence_ordering) @keyword) |
| 115 | + (cardinality_reference_expression (sequence_uniqueness) @keyword) |
| 116 | + (cardinality_reference_expression [ "{" "}" ] @punctuation.bracket) |
119 | 117 |
|
120 | | - (function_body (function_op_by_definition) @operator) |
| 118 | + (function_body [ ":=" "≔" ] @operator) |
121 | 119 |
|
122 | 120 | (function_composition subject: (reserved_self) @variable.builtin) |
123 | 121 | (function_composition name: (identifier) @function.call) |
124 | | - (function_composition [ "·" "." ] @operator) |
| 122 | + (function_composition [ "." ] @operator) |
125 | 123 |
|
126 | 124 | (constraint_sentence [ "(" ")" ] @punctuation.bracket) |
127 | 125 |
|
128 | 126 | (atomic_sentence |
129 | 127 | predicate: (term (identifier_reference) @function.call)) |
130 | | - |
131 | | - (actual_arguments [ "(" ")" ] @punctuation.bracket) |
132 | | - (actual_arguments |
| 128 | + (atomic_sentence [ "(" ")" ] @punctuation.bracket) |
| 129 | + (atomic_sentence |
133 | 130 | argument: (term (identifier_reference (identifier) @variable))) |
134 | 131 |
|
135 | 132 | (term (reserved_self) @variable.builtin) |
|
141 | 138 | (quantified_sentence "," @punctuation.separator) |
142 | 139 |
|
143 | 140 | (variable (identifier) @variable) |
| 141 | + (variable range: (identifier_reference) @type) |
144 | 142 |
|
145 | 143 | (functional_term |
146 | 144 | function: (term (identifier_reference) @function.call)) |
| 145 | + (functional_term [ "(" ")" ] @punctuation.bracket) |
| 146 | + (functional_term |
| 147 | + argument: (term (identifier_reference (identifier) @variable))) |
147 | 148 |
|
148 | | - (sequence_builder [ "{" "}" ] @punctuation.bracket |
149 | | - (set_op_builder) @punctuation.separator) |
| 149 | + (sequence_builder |
| 150 | + [ "{" "}" ] @punctuation.bracket |
| 151 | + (set_op_builder) @punctuation.separator) |
150 | 152 |
|
151 | 153 | (sequence_of_predicate_values [ "{" "}" ] @punctuation.bracket) |
152 | 154 | (sequence_of_predicate_values (sequence_ordering) @keyword) |
|
180 | 182 | [ (set_op_membership "∈" @operator) |
181 | 183 | (set_op_membership "in" @keyword) ]) |
182 | 184 |
|
| 185 | + (set_expression_sentence |
| 186 | + [ (set_op_union "∪" @operator) |
| 187 | + (set_op_union "union" @keyword) |
| 188 | + (set_op_intersection "∩" @operator) |
| 189 | + (set_op_intersection "intersection" @keyword) |
| 190 | + (set_op_complement "∖" @operator) |
| 191 | + (set_op_complement "complement" @keyword) |
| 192 | + (set_op_subset "⊂" @operator) |
| 193 | + (set_op_subset "subset" @keyword) |
| 194 | + (set_op_subset_or_equal "⊆" @operator) |
| 195 | + (set_op_subset_or_equal "subseteq" @keyword) |
| 196 | + (set_op_supset "⊃" @operator) |
| 197 | + (set_op_supset "supset" @keyword) |
| 198 | + (set_op_supset_or_equal "⊇" @operator) |
| 199 | + (set_op_supset_or_equal "supseteq" @keyword) |
| 200 | + (set_op_product "⨉" @operator) |
| 201 | + (set_op_product "product" @keyword) |
| 202 | + (set_op_membership "∈" @operator) |
| 203 | + (set_op_membership "in" @keyword) ]) |
| 204 | + |
| 205 | + (arithmetic_expression_sentence |
| 206 | + [ (math_op_multiply [ "*" "✕" ] @operator) |
| 207 | + (math_op_divide [ "/" "÷" ] @operator) |
| 208 | + (math_op_modulo "mod" @keyword) |
| 209 | + (math_op_modulo "%" @operator) |
| 210 | + (math_op_add "+" @operator) |
| 211 | + (math_op_subtract "-" @operator) ]) |
| 212 | + |
183 | 213 | ;; ------------------------------------------------------------------- |
184 | 214 | ;; Types |
185 | 215 | ;; ------------------------------------------------------------------- |
|
198 | 228 |
|
199 | 229 | (datatype_def_restriction [ "{" "}" ] @punctuation.bracket) |
200 | 230 | (length_restriction_facet |
201 | | - [ "length" |
202 | | - "maxLength" |
203 | | - "minLength" ] @property |
| 231 | + [ "length" "maxLength" "minLength" ] @property |
204 | 232 | "=" @operator) |
205 | 233 | (digit_restriction_facet |
206 | | - [ "fractionDigits" |
207 | | - "totalDigits" ] @property |
| 234 | + [ "fractionDigits" "totalDigits" ] @property |
208 | 235 | "=" @operator) |
209 | 236 | (value_restriction_facet |
210 | | - [ "maxExclusive" |
211 | | - "maxInclusive" |
212 | | - "minExclusive" |
213 | | - "minInclusive" ] @property |
| 237 | + [ "maxExclusive" "maxInclusive" "minExclusive" "minInclusive" ] @property |
214 | 238 | "=" @operator) |
215 | 239 | (tz_restriction_facet |
216 | 240 | "explicitTimezone" @property |
217 | | - "=" @operator) |
218 | | - (pattern_restriction_facet [ "[" "]" ] @punctuation.bracket) |
| 241 | + "=" @operator |
| 242 | + (tz_restriction_value) @keyword) |
219 | 243 | (pattern_restriction_facet |
220 | 244 | "pattern" @property |
221 | 245 | "=" @operator |
222 | 246 | (quoted_string) @string) |
| 247 | + (pattern_restriction_facet [ "[" "]" ] @punctuation.bracket) |
223 | 248 |
|
224 | 249 | (kw_is_fixed) @keyword |
225 | 250 |
|
226 | | - (tz_restriction_value) @keyword |
227 | | - |
228 | 251 | (dimension_def "dimension" @keyword name: (identifier) @type.definition) |
229 | 252 |
|
230 | 253 | (entity_def "entity" @keyword name: (identifier) @type.definition) |
|
238 | 261 | (structure_def "structure" @keyword name: (identifier) @type.definition) |
239 | 262 |
|
240 | 263 | (union_def "union" @keyword name: (identifier) @type.definition) |
241 | | - (from_definition_clause |
242 | | - "from" @keyword |
243 | | - from: (identifier_reference) @type |
244 | | - "with" @keyword) |
245 | | - (from_definition_clause wildcard: (_) @type.builtin) |
246 | | - (from_definition_clause member: (identifier) @variable) |
| 264 | + |
| 265 | + (from_definition_clause "from" @keyword from: (identifier_reference) @type) |
| 266 | + |
| 267 | + (from_definition_with "with" @keyword) |
| 268 | + (from_definition_with wildcard: (_) @type.builtin) |
| 269 | + (from_definition_with member: (identifier) @variable) |
| 270 | + (from_definition_with [ "[" "]" ] @punctuation.bracket) |
| 271 | + |
| 272 | + (from_definition_without "without" @keyword) |
| 273 | + (from_definition_without member: (identifier) @variable) |
| 274 | + (from_definition_without [ "[" "]" ] @punctuation.bracket) |
247 | 275 |
|
248 | 276 | (source_entity "source" @keyword entity: (identifier_reference) @type) |
249 | 277 | (source_entity "with" @keyword) |
|
265 | 293 | (type_class_def "class" @keyword name: (identifier) @type.definition) |
266 | 294 | (type_class_def [ "(" ")" ] @punctuation.bracket) |
267 | 295 |
|
268 | | - (type_variable name: (identifier) @type) |
269 | | - (type_variable (type_op_combiner) @operator) |
| 296 | + (type_parameter name: (identifier) @type.definition) |
| 297 | + (type_parameter (type_op_combiner) @operator) |
270 | 298 |
|
271 | | - (type_class_reference name: (identifier_reference) @type) |
| 299 | + (type_parameter_restriction class: (identifier_reference) @type) |
| 300 | + (type_parameter_restriction [ "(" ")" ] @punctuation.bracket) |
272 | 301 |
|
273 | | - (type_class_arguments [ "(" ")" ] @punctuation.bracket) |
| 302 | + ;;(type_restriction_argument (identifier) @type.definition) |
274 | 303 |
|
275 | 304 | (method_def |
276 | 305 | (function_signature name: (identifier) @method.definition)) |
|
312 | 341 | (string (quoted_string) @string) |
313 | 342 | (string language: (language_tag) @property) |
314 | 343 |
|
315 | | - (iri) @string.special |
316 | | - |
317 | | - (binary) @string.special |
| 344 | + [ |
| 345 | + (binary) |
| 346 | + (iri) ] @string.special |
318 | 347 |
|
319 | 348 | [ |
320 | 349 | (rational) |
|
0 commit comments