tree-sitter-sdml 0.3.2__cp38-abi3-macosx_14_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. tree_sitter_sdml/__init__.py +5 -0
  2. tree_sitter_sdml/__init__.pyi +1 -0
  3. tree_sitter_sdml/_binding.abi3.so +0 -0
  4. tree_sitter_sdml/binding.c +27 -0
  5. tree_sitter_sdml/py.typed +0 -0
  6. tree_sitter_sdml/queries/#folds.scm# +30 -0
  7. tree_sitter_sdml/queries/.folds.scm.~undo-tree~ +4 -0
  8. tree_sitter_sdml/queries/.highlight.scm.~undo-tree~ +285 -0
  9. tree_sitter_sdml/queries/.highlight.scm~.~undo-tree~ +4 -0
  10. tree_sitter_sdml/queries/.highlights.scm.~undo-tree~ +17 -0
  11. tree_sitter_sdml/queries/.indent.scm.~undo-tree~ +4 -0
  12. tree_sitter_sdml/queries/.injections.scm.~undo-tree~ +7 -0
  13. tree_sitter_sdml/queries/.lint.scm.~undo-tree~ +6 -0
  14. tree_sitter_sdml/queries/.locals.scm.~undo-tree~ +19 -0
  15. tree_sitter_sdml/queries/.tags.scm.~undo-tree~ +59 -0
  16. tree_sitter_sdml/queries/folds.scm +27 -0
  17. tree_sitter_sdml/queries/folds.scm~ +4 -0
  18. tree_sitter_sdml/queries/highlight.scm~ +0 -0
  19. tree_sitter_sdml/queries/highlights.scm +266 -0
  20. tree_sitter_sdml/queries/highlights.scm~ +270 -0
  21. tree_sitter_sdml/queries/indent.scm +28 -0
  22. tree_sitter_sdml/queries/indent.scm~ +16 -0
  23. tree_sitter_sdml/queries/injections.scm +4 -0
  24. tree_sitter_sdml/queries/injections.scm~ +4 -0
  25. tree_sitter_sdml/queries/locals.scm +22 -0
  26. tree_sitter_sdml/queries/locals.scm~ +16 -0
  27. tree_sitter_sdml/queries/tags.scm +85 -0
  28. tree_sitter_sdml/queries/tags.scm~ +95 -0
  29. tree_sitter_sdml-0.3.2.dist-info/LICENSE +13 -0
  30. tree_sitter_sdml-0.3.2.dist-info/METADATA +655 -0
  31. tree_sitter_sdml-0.3.2.dist-info/RECORD +33 -0
  32. tree_sitter_sdml-0.3.2.dist-info/WHEEL +5 -0
  33. tree_sitter_sdml-0.3.2.dist-info/top_level.txt +2 -0
@@ -0,0 +1,266 @@
1
+ ;; ---------------------------------------------------------------------------
2
+ ;; Comments
3
+ ;; ---------------------------------------------------------------------------
4
+
5
+ (line_comment) @comment
6
+
7
+ ;; ---------------------------------------------------------------------------
8
+ ;; Reserved Keywords
9
+ ;; ---------------------------------------------------------------------------
10
+
11
+ [
12
+ "module"
13
+ "import"
14
+ "assert"
15
+ "class"
16
+ "datatype"
17
+ "entity"
18
+ "enum"
19
+ "event"
20
+ "property"
21
+ "rdf"
22
+ "structure"
23
+ "union"
24
+ "is"
25
+ "of"
26
+ "end"
27
+ ] @keyword
28
+
29
+ ;; ---------------------------------------------------------------------------
30
+ ;; Operators
31
+ ;; ---------------------------------------------------------------------------
32
+
33
+ [
34
+ "="
35
+ ":="
36
+ "≔"
37
+ "¬"
38
+ "∧"
39
+ "∨"
40
+ "⊻"
41
+ "==>"
42
+ "⇒"
43
+ "<==>"
44
+ "⇔"
45
+ "∀"
46
+ "∃"
47
+ "∈"
48
+ "->"
49
+ "→"
50
+ "<-"
51
+ "←"
52
+ ".."
53
+ ] @operator
54
+
55
+ ;; ---------------------------------------------------------------------------
56
+ ;; Module & Imports
57
+ ;; ---------------------------------------------------------------------------
58
+
59
+ (module name: (identifier) @module.definition)
60
+ (module "version" @keyword)
61
+
62
+ (import_statement [ "[" "]" ] @punctuation.bracket)
63
+
64
+ (member_import name: (qualified_identifier) @type)
65
+
66
+ (module_import name: (identifier) @module)
67
+
68
+ ;; ---------------------------------------------------------------------------
69
+ ;; Annotations and Constraints
70
+ ;; ---------------------------------------------------------------------------
71
+
72
+ (annotation_property
73
+ "@" @property
74
+ name: (identifier_reference) @property)
75
+
76
+ (annotation_property value: (value (identifier_reference) @type))
77
+
78
+ (constraint name: (identifier) @property)
79
+
80
+ (informal_constraint (quoted_string) @embedded)
81
+ (informal_constraint language: (controlled_language_tag) @property)
82
+
83
+ (constraint_environment (constraint_environment_end) @keyword)
84
+
85
+ (environment_def "def" @keyword)
86
+ (environment_def (identifier) @function.definition . (function_def))
87
+ (environment_def (identifier) @constant . (constant_def))
88
+
89
+ (function_signature target: (_) @type)
90
+ (function_signature [ "(" ")" ] @punctuation.bracket)
91
+
92
+ (function_parameter name: (identifier) @variable.parameter)
93
+ (function_parameter target: (_) @type)
94
+
95
+ (optional) @operator
96
+
97
+ (function_cardinality_expression (sequence_ordering) @keyword)
98
+ (function_cardinality_expression (sequence_uniqueness) @keyword)
99
+ (function_cardinality_expression [ "{" "}" ] @punctuation.bracket)
100
+
101
+ (function_composition subject: (reserved_self) @variable.builtin)
102
+ (function_composition name: (identifier) @function.call)
103
+ (function_composition "." @punctuation.delimiter)
104
+
105
+ (constraint_sentence [ "(" ")" ] @punctuation.bracket)
106
+
107
+ (atomic_sentence
108
+ predicate: (term (identifier_reference) @function.call))
109
+
110
+ (actual_arguments [ "(" ")" ] @punctuation.bracket)
111
+ (actual_arguments
112
+ argument: (term (identifier_reference (identifier) @variable)))
113
+
114
+ (term (reserved_self) @variable.builtin)
115
+
116
+ ((equation lhs: (term (identifier_reference) @variable)) (#is-not? local))
117
+
118
+ ((equation rhs: (term (identifier_reference) @variable)) (#is-not? local))
119
+
120
+ (quantified_sentence "," @punctuation.separator)
121
+
122
+ (quantified_variable source: (reserved_self) @variable.builtin)
123
+ (quantified_variable name: (identifier) @variable.parameter)
124
+ (quantified_variable "in" @keyword)
125
+
126
+ (functional_term
127
+ function: (term (identifier_reference) @function.call))
128
+
129
+ (sequence_builder [ "{" "}" ] @punctuation.bracket
130
+ "|" @punctuation.separator)
131
+
132
+ (named_variable_set (identifier) @variable)
133
+
134
+ (mapping_variable
135
+ domain: (identifier) @variable range: (identifier) @variable)
136
+
137
+ (sequence_builder_body [ "(" ")" ] @punctuation.bracket)
138
+
139
+ (sequence_of_predicate_values (identifier_reference) @type)
140
+ (sequence_of_predicate_values [ "[" "]" ] @punctuation.bracket)
141
+
142
+ (negation "not" @keyword)
143
+ (conjunction "and" @keyword)
144
+ (disjunction "or" @keyword)
145
+ (exclusive_disjunction "xor" @keyword)
146
+ (implication "implies" @keyword)
147
+ (biconditional "iff" @keyword)
148
+
149
+ (universal "forall" @keyword)
150
+ (existential "exists" @keyword)
151
+
152
+ ;; ---------------------------------------------------------------------------
153
+ ;; Types
154
+ ;; ---------------------------------------------------------------------------
155
+
156
+ [
157
+ (builtin_simple_type)
158
+ (unknown_type)
159
+ ] @type.builtin
160
+
161
+ (data_type_def name: (identifier) @type.definition)
162
+ (data_type_def base: (identifier_reference) @type)
163
+ (data_type_def opaque: (opaque) @keyword)
164
+
165
+ (entity_def name: (identifier) @type.definition)
166
+
167
+ (enum_def name: (identifier) @type.definition)
168
+
169
+ (event_def "source" @keyword)
170
+ (event_def
171
+ name: (identifier) @type.definition
172
+ source: (identifier_reference) @type)
173
+
174
+ (structure_def name: (identifier) @type.definition)
175
+
176
+ (union_def name: (identifier) @type.definition)
177
+
178
+ ;; ---------------------------------------------------------------------------
179
+ ;; RDF Definitions
180
+ ;; ---------------------------------------------------------------------------
181
+
182
+ (rdf_def name: (identifier) @type.definition)
183
+ (rdf_types "type" @keyword type: (identifier_reference) @type)
184
+ (rdf_types [ "[" "]" ] @punctuation.bracket)
185
+
186
+ ;; ---------------------------------------------------------------------------
187
+ ;; Type Classes
188
+ ;; ---------------------------------------------------------------------------
189
+
190
+ (type_class_def name: (identifier) @type.definition)
191
+ (type_class_def [ "(" ")" ] @punctuation.bracket)
192
+
193
+ (type_variable name: (identifier) @type)
194
+ (type_variable "+" @operator)
195
+
196
+ (type_class_reference name: (identifier_reference) @type)
197
+
198
+ (type_class_arguments [ "(" ")" ] @punctuation.bracket)
199
+
200
+ (method_def "def" @keyword)
201
+ (method_def name: (identifier) @method.definition)
202
+
203
+ (wildcard) @type.builtin
204
+
205
+ ;; ---------------------------------------------------------------------------
206
+ ;; Members
207
+ ;; ---------------------------------------------------------------------------
208
+
209
+ (entity_identity "identity" @keyword)
210
+
211
+ (member_def name: (identifier) @variable.field)
212
+ (member_def target: (type_reference) @type)
213
+
214
+ (property_ref
215
+ "ref" @keyword
216
+ property: (identifier_reference) @variable.field)
217
+
218
+ (value_variant name: (identifier) @constant)
219
+
220
+ (type_variant (identifier_reference) @type)
221
+ (type_variant rename: (identifier) @type)
222
+ (type_variant "as" @keyword)
223
+
224
+ (cardinality_expression (sequence_ordering) @keyword)
225
+ (cardinality_expression (sequence_uniqueness) @keyword)
226
+ (cardinality_expression [ "{" "}" ] @punctuation.bracket)
227
+
228
+ ;; ---------------------------------------------------------------------------
229
+ ;; Values
230
+ ;; ---------------------------------------------------------------------------
231
+
232
+ (string (quoted_string) @string)
233
+ (string language: (language_tag) @property)
234
+
235
+ (iri) @string.special
236
+
237
+ (binary) @string.special
238
+
239
+ [
240
+ (decimal)
241
+ (double)
242
+ (integer)
243
+ (unsigned)
244
+ ] @number
245
+
246
+ (boolean) @boolean
247
+
248
+ (value_constructor name: (identifier_reference) @function.call)
249
+ (value_constructor [ "(" ")" ] @punctuation.bracket)
250
+
251
+ (value (identifier_reference) @type)
252
+
253
+ (sequence_of_values (identifier_reference) @type)
254
+ (sequence_of_values [ "[" "]" ] @punctuation.bracket)
255
+
256
+ ;; ---------------------------------------------------------------------------
257
+ ;; Errors
258
+ ;; ---------------------------------------------------------------------------
259
+
260
+ ;; Highlight errors in red. This is not very useful in practice, as text will
261
+ ;; be highlighted as user types, and the error could be elsewhere in the code.
262
+
263
+ (
264
+ (ERROR) @error
265
+ (#set! "priority" 110)
266
+ )
@@ -0,0 +1,270 @@
1
+ ;; ---------------------------------------------------------------------------
2
+ ;; Comments
3
+ ;; ---------------------------------------------------------------------------
4
+
5
+ (line_comment) @comment
6
+
7
+ ;; ---------------------------------------------------------------------------
8
+ ;; Reserved Keywords
9
+ ;; ---------------------------------------------------------------------------
10
+
11
+ [
12
+ "module"
13
+ "import"
14
+ "assert"
15
+ "class"
16
+ "datatype"
17
+ "entity"
18
+ "enum"
19
+ "event"
20
+ "property"
21
+ "rdf"
22
+ "structure"
23
+ "union"
24
+ "is"
25
+ "of"
26
+ "end"
27
+ ] @keyword
28
+
29
+ ;; ---------------------------------------------------------------------------
30
+ ;; Operators
31
+ ;; ---------------------------------------------------------------------------
32
+
33
+ [
34
+ "="
35
+ ":="
36
+ "≔"
37
+ "¬"
38
+ "∧"
39
+ "∨"
40
+ "⊻"
41
+ "==>"
42
+ "⇒"
43
+ "<==>"
44
+ "⇔"
45
+ "∀"
46
+ "∃"
47
+ "∈"
48
+ "->"
49
+ "→"
50
+ "<-"
51
+ "←"
52
+ ".."
53
+ ] @operator
54
+
55
+ ;; ---------------------------------------------------------------------------
56
+ ;; Module & Imports
57
+ ;; ---------------------------------------------------------------------------
58
+
59
+ (module name: (identifier) @module.definition)
60
+ (module "version" @keyword)
61
+
62
+ (import_statement [ "[" "]" ] @punctuation.bracket)
63
+
64
+ (member_import name: (qualified_identifier) @type)
65
+
66
+ (module_import name: (identifier) @module)
67
+
68
+ ;; ---------------------------------------------------------------------------
69
+ ;; Annotations and Constraints
70
+ ;; ---------------------------------------------------------------------------
71
+
72
+ (annotation_property
73
+ "@" @property
74
+ name: (identifier_reference) @property)
75
+
76
+ (annotation_property value: (value (identifier_reference) @type))
77
+
78
+ (constraint name: (identifier) @property)
79
+
80
+ (informal_constraint (quoted_string) @embedded)
81
+ (informal_constraint language: (controlled_language_tag) @property)
82
+
83
+ (constraint_environment (constraint_environment_end) @keyword)
84
+
85
+ (environment_def "def" @keyword)
86
+ (environment_def (identifier) @function.definition . (function_def))
87
+ (environment_def (identifier) @constant . (constant_def))
88
+
89
+ (function_signature target: (_) @type)
90
+ (function_signature [ "(" ")" ] @punctuation.bracket)
91
+
92
+ (function_parameter name: (identifier) @variable.parameter)
93
+ (function_parameter target: (_) @type)
94
+
95
+ (optional) @operator
96
+
97
+ (function_cardinality_expression (sequence_ordering) @keyword)
98
+ (function_cardinality_expression (sequence_uniqueness) @keyword)
99
+ (function_cardinality_expression [ "{" "}" ] @punctuation.bracket)
100
+
101
+ (function_composition subject: (reserved_self) @variable.builtin)
102
+ (function_composition name: (identifier) @function.call)
103
+ (function_composition "." @punctuation.delimiter)
104
+
105
+ (constraint_sentence [ "(" ")" ] @punctuation.bracket)
106
+
107
+ (atomic_sentence
108
+ predicate: (term (identifier_reference) @function.call))
109
+
110
+ (actual_arguments [ "(" ")" ] @punctuation.bracket)
111
+ (actual_arguments
112
+ argument: (term (identifier_reference (identifier) @variable)))
113
+
114
+ (term (reserved_self) @variable.builtin)
115
+
116
+ ((equation lhs: (term (identifier_reference) @variable)) (#is-not? local))
117
+
118
+ ((equation rhs: (term (identifier_reference) @variable)) (#is-not? local))
119
+
120
+ (quantified_sentence "," @punctuation.separator)
121
+
122
+ (quantified_variable source: (reserved_self) @variable.builtin)
123
+ (quantified_variable name: (identifier) @variable.parameter)
124
+ (quantified_variable "in" @keyword)
125
+
126
+ (functional_term
127
+ function: (term (identifier_reference) @function.call))
128
+
129
+ (sequence_builder [ "{" "}" ] @punctuation.bracket
130
+ "|" @punctuation.separator)
131
+
132
+ (named_variable_set (identifier) @variable)
133
+
134
+ (mapping_variable
135
+ domain: (identifier) @variable range: (identifier) @variable)
136
+
137
+ (sequence_builder_body [ "(" ")" ] @punctuation.bracket)
138
+
139
+ (sequence_of_predicate_values (identifier_reference) @type)
140
+ (sequence_of_predicate_values [ "[" "]" ] @punctuation.bracket)
141
+
142
+ (negation "not" @keyword)
143
+ (conjunction "and" @keyword)
144
+ (disjunction "or" @keyword)
145
+ (exclusive_disjunction "xor" @keyword)
146
+ (implication "implies" @keyword)
147
+ (biconditional "iff" @keyword)
148
+
149
+ (universal "forall" @keyword)
150
+ (existential "exists" @keyword)
151
+
152
+ ;; ---------------------------------------------------------------------------
153
+ ;; Types
154
+ ;; ---------------------------------------------------------------------------
155
+
156
+ [
157
+ (builtin_simple_type)
158
+ (unknown_type)
159
+ ] @type.builtin
160
+
161
+ (data_type_def name: (identifier) @type.definition)
162
+ (data_type_def base: (identifier_reference) @type)
163
+ (data_type_def opaque: (opaque) @keyword)
164
+
165
+ (entity_def name: (identifier) @type.definition)
166
+
167
+ (enum_def name: (identifier) @type.definition)
168
+
169
+ (event_def "source" @keyword)
170
+ (event_def
171
+ name: (identifier) @type.definition
172
+ source: (identifier_reference) @type)
173
+
174
+ (structure_def name: (identifier) @type.definition)
175
+
176
+ (union_def name: (identifier) @type.definition)
177
+
178
+ ;; ---------------------------------------------------------------------------
179
+ ;; RDF Definitions
180
+ ;; ---------------------------------------------------------------------------
181
+
182
+ (rdf_def name: (identifier) @type.definition)
183
+ (rdf_types "type" @keyword type: (identifier_reference) @type)
184
+ (rdf_types [ "[" "]" ] @punctuation.bracket)
185
+
186
+ ;; ---------------------------------------------------------------------------
187
+ ;; Type Classes
188
+ ;; ---------------------------------------------------------------------------
189
+
190
+ (type_class_def name: (identifier) @type.definition)
191
+ (type_class_def [ "(" ")" ] @punctuation.bracket)
192
+
193
+ (type_variable name: (identifier) @type)
194
+ (type_variable "+" @operator)
195
+
196
+ (type_class_reference name: (identifier_reference) @type)
197
+
198
+ (type_class_arguments [ "(" ")" ] @punctuation.bracket)
199
+
200
+ (method_def "def" @keyword)
201
+ (method_def name: (identifier) @method.definition)
202
+
203
+ (wildcard) @type.builtin
204
+
205
+ ;; ---------------------------------------------------------------------------
206
+ ;; Members
207
+ ;; ---------------------------------------------------------------------------
208
+
209
+ (entity_identity "identity" @keyword)
210
+
211
+ (member_def name: (identifier) @variable.field)
212
+ (member_def target: (type_reference) @type)
213
+ (member_def
214
+ feature: (feature_reference
215
+ "features" @keyword
216
+ target: (identifier_reference) @type))
217
+
218
+ (property_ref
219
+ "ref" @keyword
220
+ property: (identifier_reference) @variable.field)
221
+
222
+ (value_variant name: (identifier) @constant)
223
+
224
+ (type_variant (identifier_reference) @type)
225
+ (type_variant rename: (identifier) @type)
226
+ (type_variant "as" @keyword)
227
+
228
+ (cardinality_expression (sequence_ordering) @keyword)
229
+ (cardinality_expression (sequence_uniqueness) @keyword)
230
+ (cardinality_expression [ "{" "}" ] @punctuation.bracket)
231
+
232
+ ;; ---------------------------------------------------------------------------
233
+ ;; Values
234
+ ;; ---------------------------------------------------------------------------
235
+
236
+ (string (quoted_string) @string)
237
+ (string language: (language_tag) @property)
238
+
239
+ (iri) @string.special
240
+
241
+ (binary) @string.special
242
+
243
+ [
244
+ (decimal)
245
+ (double)
246
+ (integer)
247
+ (unsigned)
248
+ ] @number
249
+
250
+ (boolean) @boolean
251
+
252
+ (value_constructor name: (identifier_reference) @function.call)
253
+ (value_constructor [ "(" ")" ] @punctuation.bracket)
254
+
255
+ (value (identifier_reference) @type)
256
+
257
+ (sequence_of_values (identifier_reference) @type)
258
+ (sequence_of_values [ "[" "]" ] @punctuation.bracket)
259
+
260
+ ;; ---------------------------------------------------------------------------
261
+ ;; Errors
262
+ ;; ---------------------------------------------------------------------------
263
+
264
+ ;; Highlight errors in red. This is not very useful in practice, as text will
265
+ ;; be highlighted as user types, and the error could be elsewhere in the code.
266
+
267
+ (
268
+ (ERROR) @error
269
+ (#set! "priority" 110)
270
+ )
@@ -0,0 +1,28 @@
1
+ [
2
+ "is"
3
+ "of"
4
+ ] @indent
5
+
6
+ [
7
+ "end"
8
+ ] @indent.end
9
+
10
+ [
11
+ (string)
12
+ (line_comment)
13
+ (function_body)
14
+ ] @indent.auto
15
+
16
+ (constraint_environment_end) @indent.dedent
17
+
18
+ (function_signature "(" @indent ")" @indent.end)
19
+
20
+ (constraint_sentence "(" @indent ")" @indent.end)
21
+
22
+ (sequence_builder "{" @indent "}" @indent.end)
23
+
24
+ (actual_arguments "(" @indent ")" @indent.end)
25
+
26
+ (sequence_of_predicate_values "[" @indent "]" @indent.end)
27
+
28
+ (sequence_of_values "[" @indent "]" @indent.end)
@@ -0,0 +1,16 @@
1
+ [
2
+ "("
3
+ "["
4
+ "{"
5
+ ] @indent
6
+
7
+ [
8
+ ")"
9
+ "]"
10
+ "}"
11
+ ] @indent.end
12
+
13
+ [
14
+ (documentation_comment)
15
+ (line_comment)
16
+ ] @ignore
@@ -0,0 +1,4 @@
1
+ [
2
+ (line_comment)
3
+ (informal_constraint)
4
+ ] @comment
@@ -0,0 +1,4 @@
1
+ [
2
+ (documentation_comment)
3
+ (line_comment)
4
+ ] @comment
@@ -0,0 +1,22 @@
1
+ ;; ---------------------------------------------------------------------------
2
+ ;; Constraint Scopes
3
+ ;; ---------------------------------------------------------------------------
4
+
5
+ (formal_constraint) @local.scope
6
+
7
+ (environment_def name: (identifier) @local.definition)
8
+ (environment_def) @local.scope
9
+
10
+ (function_parameter name: (identifier) @local.definition)
11
+
12
+ (quantified_sentence) @local.scope
13
+
14
+ (quantified_variable name: (identifier) @local.definition)
15
+
16
+ (sequence_builder) @local.scope
17
+
18
+ (named_variable_set (identifier) @local.reference)
19
+
20
+ (mapping_variable domain: (identifier) range: (identifier) @local.reference)
21
+
22
+ (term (identifier_reference) @local.reference)
@@ -0,0 +1,16 @@
1
+ ;; ---------------------------------------------------------------------------
2
+ ;; Constraint Scopes
3
+ ;; ---------------------------------------------------------------------------
4
+
5
+ (formal_constraint) @local.scope
6
+ (environment_definition name: (identifier) @local.definition)
7
+
8
+ (environment_definition) @local.scope
9
+ (fn_parameter name: (identifier) @local.definition)
10
+
11
+ (quantified_sentence) @local.scope
12
+ (quantifier_binding name: (identifier) @local.definition)
13
+
14
+ (sequence_comprehension) @local.scope
15
+
16
+ (returned_value (identifier) @local.definition)