@fraczak/k 6.1.3 → 6.2.1
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.
- package/AGENTS.md +4 -4
- package/CLAUDE.md +1 -1
- package/DOCS/KIR_SPECIALIZATION_DESIGN.md +11 -2
- package/DOCS/KVM_EXECUTION_MODEL.md +413 -0
- package/DOCS/OBJECT_FILE_AND_PATTERN.md +6 -0
- package/DOCS/REPL.md +22 -17
- package/{NAT.k~ → Examples/arithmetics.k} +1 -1
- package/Examples/bnat.k +291 -0
- package/Examples/byte.k +67 -0
- package/Examples/code.k +44 -0
- package/Examples/esc.k +9 -0
- package/Examples/ieee.k +15766 -0
- package/Examples/list.k +7 -0
- package/Examples/nat.k +12 -0
- package/Examples/vhdl_to_k.k +50 -0
- package/README.md +14 -5
- package/backend-api.mjs +12 -0
- package/codecs/runtime/codec.mjs +1 -0
- package/export.mjs +10 -0
- package/k-vscode/README.md +10 -1
- package/k-vscode/extension.js +273 -0
- package/k-vscode/package.json +22 -0
- package/k-vscode/syntaxes/k.tmLanguage.json +493 -137
- package/k-vscode/test/background-ranges.test.js +50 -0
- package/k-vscode/themes/k-contrast-color-theme.json +104 -0
- package/kvm.mjs +523 -0
- package/package.json +4 -3
- package/repl.mjs +43 -2
- package/run.mjs +1 -1
- package/scripts/run-tests.mjs +55 -0
- package/tests/README.md +35 -0
- package/{Code-derivation-tests → tests/code-derivation}/codec-witness-pattern.mjs +4 -4
- package/{Code-derivation-tests → tests/code-derivation}/convergence-strategy.mjs +1 -1
- package/{Code-derivation-tests → tests/code-derivation}/dot.mjs +1 -1
- package/{Code-derivation-tests → tests/code-derivation}/filter-syntax.mjs +1 -1
- package/{Code-derivation-tests → tests/code-derivation}/index.mjs +1 -1
- package/{Code-derivation-tests → tests/code-derivation}/pattern-envelope.mjs +5 -5
- package/{Code-derivation-tests → tests/code-derivation}/product.mjs +1 -1
- package/{tests.sh → tests/integration.sh} +11 -6
- package/{test-fingerprint.mjs → tests/test-fingerprint.mjs} +3 -3
- package/{test-hash-fuzz.mjs → tests/test-hash-fuzz.mjs} +1 -1
- package/{test-hash-normalization.mjs → tests/test-hash-normalization.mjs} +2 -2
- package/{test-ieee-arithmetic.mjs → tests/test-ieee-arithmetic.mjs} +14 -27
- package/{test-k-object.mjs → tests/test-k-object.mjs} +8 -8
- package/tests/test-kvm.mjs +163 -0
- package/{test-repl.mjs → tests/test-repl.mjs} +22 -4
- package/{test.mjs → tests/test.mjs} +1 -1
- package/.codex +0 -0
- package/DOCS/a.html +0 -398
- package/DOCS/dependency-graph.html +0 -140
- package/DOCS/dependency-graph.md +0 -144
- package/UU/ta.k +0 -1
- package/UU/ta.k~ +0 -0
- package/UU/tb.k +0 -0
- package/UU/tc.k +0 -0
- package/a.k +0 -138
- package/a.klib +0 -1
- package/codecs/BINARY_FORMAT.html +0 -471
- package/codecs/POLYMORPHIC_BINARY_FORMAT.html +0 -355
- package/core.json +0 -1
- package/core.klib +0 -1
- package/core.klib~ +0 -0
- package/ieee.klib +0 -1
- package/k-vscode/package-lock.json +0 -4176
- package/kkk.k +0 -197
- package/kkk.klib +0 -0
- package/kkk.klib~ +0 -0
- package/nak.klib +0 -1
- package/nak2.klib +0 -1
- package/nat.k +0 -10
- package/nat2.k +0 -9
- package/p.json +0 -5475
- package/type_registry/registry.mjs~ +0 -105
- package/type_registry/typeParser.jison~ +0 -132
- /package/{Code-derivation-tests → tests/code-derivation}/blowup.mjs +0 -0
- /package/{Code-derivation-tests → tests/code-derivation}/bnat.mjs +0 -0
- /package/{Code-derivation-tests → tests/code-derivation}/loop.mjs +0 -0
- /package/{Code-derivation-tests → tests/code-derivation}/nat.mjs +0 -0
- /package/{Code-derivation-tests → tests/code-derivation}/not-not.mjs +0 -0
- /package/{Code-derivation-tests → tests/code-derivation}/rlz.mjs +0 -0
|
@@ -6,236 +6,592 @@
|
|
|
6
6
|
{ "include": "#comment-block" },
|
|
7
7
|
{ "include": "#comment-line" },
|
|
8
8
|
{ "include": "#type-definition" },
|
|
9
|
-
{ "include": "#
|
|
10
|
-
{ "include": "#
|
|
11
|
-
{ "include": "#type-ref" },
|
|
12
|
-
{ "include": "#canonical-ref" },
|
|
13
|
-
{ "include": "#projection-dot" },
|
|
14
|
-
{ "include": "#projection-slash" },
|
|
15
|
-
{ "include": "#variant-intro" },
|
|
16
|
-
{ "include": "#string-double" },
|
|
17
|
-
{ "include": "#string-single" },
|
|
18
|
-
{ "include": "#dots" },
|
|
19
|
-
{ "include": "#operators" },
|
|
20
|
-
{ "include": "#brackets" }
|
|
9
|
+
{ "include": "#relation-definition" },
|
|
10
|
+
{ "include": "#main-relation-expression" }
|
|
21
11
|
],
|
|
22
12
|
"repository": {
|
|
23
|
-
|
|
24
13
|
"comment-block": {
|
|
25
14
|
"name": "comment.block.k",
|
|
26
15
|
"begin": "/\\*",
|
|
27
16
|
"end": "\\*/",
|
|
28
|
-
"beginCaptures": {
|
|
29
|
-
|
|
17
|
+
"beginCaptures": {
|
|
18
|
+
"0": { "name": "punctuation.definition.comment.begin.k" }
|
|
19
|
+
},
|
|
20
|
+
"endCaptures": {
|
|
21
|
+
"0": { "name": "punctuation.definition.comment.end.k" }
|
|
22
|
+
}
|
|
30
23
|
},
|
|
31
|
-
|
|
32
24
|
"comment-line": {
|
|
33
25
|
"name": "comment.line.k",
|
|
34
|
-
"match": "(
|
|
26
|
+
"match": "(?://|--|%|#|\\\\\\\\).*$"
|
|
35
27
|
},
|
|
36
|
-
|
|
37
28
|
"type-definition": {
|
|
38
|
-
"comment": "$ name =
|
|
39
|
-
"
|
|
40
|
-
"
|
|
29
|
+
"comment": "$ name = code; defines a named code (type)",
|
|
30
|
+
"name": "meta.definition.type.k",
|
|
31
|
+
"contentName": "meta.expression.type.k",
|
|
32
|
+
"begin": "(\\$)\\s*([a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*)\\s*(=)",
|
|
33
|
+
"end": "(;)",
|
|
34
|
+
"beginCaptures": {
|
|
41
35
|
"1": { "name": "keyword.operator.type.k" },
|
|
42
|
-
"2": { "name": "entity.name.type.k" }
|
|
43
|
-
|
|
36
|
+
"2": { "name": "entity.name.type.k" },
|
|
37
|
+
"3": { "name": "keyword.operator.assignment.k" }
|
|
38
|
+
},
|
|
39
|
+
"endCaptures": {
|
|
40
|
+
"1": { "name": "punctuation.terminator.definition.k" }
|
|
41
|
+
},
|
|
42
|
+
"patterns": [
|
|
43
|
+
{ "include": "#type-content" }
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"relation-definition": {
|
|
47
|
+
"comment": "name = expression; defines a named relation/function",
|
|
48
|
+
"name": "meta.definition.function.k",
|
|
49
|
+
"contentName": "meta.expression.relation.k",
|
|
50
|
+
"begin": "^\\s*([a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*)\\s*(=)",
|
|
51
|
+
"end": "(;)",
|
|
52
|
+
"beginCaptures": {
|
|
53
|
+
"1": { "name": "support.function.identifier.k" },
|
|
54
|
+
"2": { "name": "keyword.operator.assignment.k" }
|
|
55
|
+
},
|
|
56
|
+
"endCaptures": {
|
|
57
|
+
"1": { "name": "punctuation.terminator.definition.k" }
|
|
58
|
+
},
|
|
59
|
+
"patterns": [
|
|
60
|
+
{ "include": "#relation-content" }
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
"main-relation-expression": {
|
|
64
|
+
"comment": "The parser requires one trailing top-level relation expression after definitions",
|
|
65
|
+
"name": "meta.expression.relation.k",
|
|
66
|
+
"begin": "(?=\\S)",
|
|
67
|
+
"end": "(?=$)",
|
|
68
|
+
"patterns": [
|
|
69
|
+
{ "include": "#relation-content" }
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"type-content": {
|
|
73
|
+
"patterns": [
|
|
74
|
+
{ "include": "#comment-block" },
|
|
75
|
+
{ "include": "#comment-line" },
|
|
76
|
+
{ "include": "#type-product" },
|
|
77
|
+
{ "include": "#type-union" },
|
|
78
|
+
{ "include": "#canonical-type-ref" },
|
|
79
|
+
{ "include": "#type-name" },
|
|
80
|
+
{ "include": "#separator" }
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
"type-product": {
|
|
84
|
+
"name": "meta.expression.type.product.k",
|
|
85
|
+
"begin": "(\\{)",
|
|
86
|
+
"end": "(\\})",
|
|
87
|
+
"beginCaptures": {
|
|
88
|
+
"1": { "name": "punctuation.section.product.begin.k" }
|
|
89
|
+
},
|
|
90
|
+
"endCaptures": {
|
|
91
|
+
"1": { "name": "punctuation.section.product.end.k" }
|
|
92
|
+
},
|
|
93
|
+
"patterns": [
|
|
94
|
+
{ "include": "#comment-block" },
|
|
95
|
+
{ "include": "#comment-line" },
|
|
96
|
+
{ "include": "#type-product-label" },
|
|
97
|
+
{ "include": "#type-product" },
|
|
98
|
+
{ "include": "#type-union" },
|
|
99
|
+
{ "include": "#canonical-type-ref" },
|
|
100
|
+
{ "include": "#type-name" },
|
|
101
|
+
{ "include": "#separator" }
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
"type-union": {
|
|
105
|
+
"name": "meta.expression.type.union.k",
|
|
106
|
+
"begin": "(<)",
|
|
107
|
+
"end": "(>)",
|
|
108
|
+
"beginCaptures": {
|
|
109
|
+
"1": { "name": "punctuation.section.union.begin.k" }
|
|
110
|
+
},
|
|
111
|
+
"endCaptures": {
|
|
112
|
+
"1": { "name": "punctuation.section.union.end.k" }
|
|
113
|
+
},
|
|
114
|
+
"patterns": [
|
|
115
|
+
{ "include": "#comment-block" },
|
|
116
|
+
{ "include": "#comment-line" },
|
|
117
|
+
{ "include": "#type-union-tag" },
|
|
118
|
+
{ "include": "#type-product" },
|
|
119
|
+
{ "include": "#type-union" },
|
|
120
|
+
{ "include": "#canonical-type-ref" },
|
|
121
|
+
{ "include": "#type-name" },
|
|
122
|
+
{ "include": "#separator" }
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
"type-product-label": {
|
|
126
|
+
"patterns": [
|
|
127
|
+
{
|
|
128
|
+
"name": "entity.name.label.k",
|
|
129
|
+
"match": "[a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*(?=\\s*[,}])"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "entity.name.label.k",
|
|
133
|
+
"match": "(?:\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*')(?=\\s*[,}])"
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
"type-union-tag": {
|
|
138
|
+
"patterns": [
|
|
139
|
+
{
|
|
140
|
+
"name": "entity.name.tag.k",
|
|
141
|
+
"match": "[a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*(?=\\s*[,>])"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"name": "entity.name.tag.k",
|
|
145
|
+
"match": "(?:\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*')(?=\\s*[,>])"
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
"type-expression": {
|
|
150
|
+
"patterns": [
|
|
151
|
+
{
|
|
152
|
+
"name": "meta.expression.type.k",
|
|
153
|
+
"match": "(\\$)\\s*(@)([a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*)",
|
|
154
|
+
"captures": {
|
|
155
|
+
"1": { "name": "keyword.operator.type.k" },
|
|
156
|
+
"2": { "name": "punctuation.definition.canonical.k" },
|
|
157
|
+
"3": { "name": "support.type.canonical.k" }
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"name": "meta.expression.type.k",
|
|
162
|
+
"match": "(\\$)\\s*([a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*)",
|
|
163
|
+
"captures": {
|
|
164
|
+
"1": { "name": "keyword.operator.type.k" },
|
|
165
|
+
"2": { "name": "support.type.k" }
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"name": "meta.expression.type.k",
|
|
170
|
+
"begin": "(\\$)\\s*(\\{)",
|
|
171
|
+
"end": "(\\})",
|
|
172
|
+
"beginCaptures": {
|
|
173
|
+
"1": { "name": "keyword.operator.type.k" },
|
|
174
|
+
"2": { "name": "punctuation.section.product.begin.k" }
|
|
175
|
+
},
|
|
176
|
+
"endCaptures": {
|
|
177
|
+
"1": { "name": "punctuation.section.product.end.k" }
|
|
178
|
+
},
|
|
179
|
+
"patterns": [
|
|
180
|
+
{ "include": "#type-product-label" },
|
|
181
|
+
{ "include": "#type-content" }
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"name": "meta.expression.type.k",
|
|
186
|
+
"begin": "(\\$)\\s*(<)",
|
|
187
|
+
"end": "(>)",
|
|
188
|
+
"beginCaptures": {
|
|
189
|
+
"1": { "name": "keyword.operator.type.k" },
|
|
190
|
+
"2": { "name": "punctuation.section.union.begin.k" }
|
|
191
|
+
},
|
|
192
|
+
"endCaptures": {
|
|
193
|
+
"1": { "name": "punctuation.section.union.end.k" }
|
|
194
|
+
},
|
|
195
|
+
"patterns": [
|
|
196
|
+
{ "include": "#type-union-tag" },
|
|
197
|
+
{ "include": "#type-content" }
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
]
|
|
44
201
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
|
|
202
|
+
"type-name": {
|
|
203
|
+
"name": "support.type.k",
|
|
204
|
+
"match": "[a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*"
|
|
205
|
+
},
|
|
206
|
+
"canonical-type-ref": {
|
|
207
|
+
"match": "(@)([a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*)",
|
|
49
208
|
"captures": {
|
|
50
|
-
"1": { "name": "
|
|
209
|
+
"1": { "name": "punctuation.definition.canonical.k" },
|
|
210
|
+
"2": { "name": "support.type.canonical.k" }
|
|
51
211
|
}
|
|
52
212
|
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
213
|
+
"relation-content": {
|
|
214
|
+
"patterns": [
|
|
215
|
+
{ "include": "#comment-block" },
|
|
216
|
+
{ "include": "#comment-line" },
|
|
217
|
+
{ "include": "#filter-expression" },
|
|
218
|
+
{ "include": "#type-expression" },
|
|
219
|
+
{ "include": "#projection-dot" },
|
|
220
|
+
{ "include": "#projection-slash" },
|
|
221
|
+
{ "include": "#variant-intro" },
|
|
222
|
+
{ "include": "#canonical-function-ref" },
|
|
223
|
+
{ "include": "#relation-product" },
|
|
224
|
+
{ "include": "#relation-union" },
|
|
225
|
+
{ "include": "#relation-parens" },
|
|
226
|
+
{ "include": "#string-double" },
|
|
227
|
+
{ "include": "#string-single" },
|
|
228
|
+
{ "include": "#dots" },
|
|
229
|
+
{ "include": "#relation-identifier" },
|
|
230
|
+
{ "include": "#separator" },
|
|
231
|
+
{ "include": "#brackets" }
|
|
232
|
+
]
|
|
233
|
+
},
|
|
234
|
+
"relation-product": {
|
|
235
|
+
"begin": "(\\{)",
|
|
236
|
+
"end": "(\\})",
|
|
237
|
+
"beginCaptures": {
|
|
238
|
+
"1": { "name": "punctuation.section.product.begin.k" }
|
|
239
|
+
},
|
|
240
|
+
"endCaptures": {
|
|
241
|
+
"1": { "name": "punctuation.section.product.end.k" }
|
|
242
|
+
},
|
|
243
|
+
"patterns": [
|
|
244
|
+
{ "include": "#relation-product-label" },
|
|
245
|
+
{ "include": "#relation-content" }
|
|
246
|
+
]
|
|
247
|
+
},
|
|
248
|
+
"relation-union": {
|
|
249
|
+
"begin": "(<)",
|
|
250
|
+
"end": "(>)",
|
|
251
|
+
"beginCaptures": {
|
|
252
|
+
"1": { "name": "punctuation.section.union.begin.k" }
|
|
253
|
+
},
|
|
254
|
+
"endCaptures": {
|
|
255
|
+
"1": { "name": "punctuation.section.union.end.k" }
|
|
256
|
+
},
|
|
257
|
+
"patterns": [
|
|
258
|
+
{ "include": "#relation-content" }
|
|
259
|
+
]
|
|
260
|
+
},
|
|
261
|
+
"relation-parens": {
|
|
262
|
+
"begin": "(\\()",
|
|
263
|
+
"end": "(\\))",
|
|
264
|
+
"beginCaptures": {
|
|
265
|
+
"1": { "name": "punctuation.section.parens.begin.k" }
|
|
266
|
+
},
|
|
267
|
+
"endCaptures": {
|
|
268
|
+
"1": { "name": "punctuation.section.parens.end.k" }
|
|
269
|
+
},
|
|
270
|
+
"patterns": [
|
|
271
|
+
{ "include": "#relation-content" }
|
|
272
|
+
]
|
|
273
|
+
},
|
|
274
|
+
"relation-product-label": {
|
|
275
|
+
"patterns": [
|
|
276
|
+
{
|
|
277
|
+
"name": "entity.name.label.k",
|
|
278
|
+
"match": "[a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*(?=\\s*[,}])"
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"name": "entity.name.label.k",
|
|
282
|
+
"match": "(?:\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*')(?=\\s*[,}])"
|
|
283
|
+
}
|
|
284
|
+
]
|
|
285
|
+
},
|
|
286
|
+
"filter-expression": {
|
|
56
287
|
"patterns": [
|
|
57
288
|
{
|
|
58
|
-
"
|
|
289
|
+
"name": "meta.expression.filter.k",
|
|
59
290
|
"begin": "(\\?)\\s*(<)",
|
|
60
|
-
"end": "(>)(?:\\s*(=)\\s*([a-zA-Z0-9_?!+\\-]
|
|
291
|
+
"end": "(>)(?:\\s*(=)\\s*([a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*))?",
|
|
61
292
|
"beginCaptures": {
|
|
62
293
|
"1": { "name": "keyword.operator.filter.k" },
|
|
63
|
-
"2": { "name": "punctuation.
|
|
294
|
+
"2": { "name": "punctuation.section.filter.union.begin.k" }
|
|
64
295
|
},
|
|
65
296
|
"endCaptures": {
|
|
66
|
-
"1": { "name": "punctuation.
|
|
67
|
-
"2": { "name": "keyword.operator.
|
|
297
|
+
"1": { "name": "punctuation.section.filter.union.end.k" },
|
|
298
|
+
"2": { "name": "keyword.operator.binding.k" },
|
|
68
299
|
"3": { "name": "variable.other.pattern.k" }
|
|
69
300
|
},
|
|
70
301
|
"patterns": [
|
|
71
|
-
{ "include": "#
|
|
72
|
-
{ "include": "#comment-line" },
|
|
73
|
-
{ "include": "#filter" },
|
|
74
|
-
{ "include": "#pattern-variable" },
|
|
75
|
-
{ "include": "#type-ref" },
|
|
76
|
-
{ "include": "#string-double" },
|
|
77
|
-
{ "include": "#string-single" },
|
|
78
|
-
{ "include": "#dots" },
|
|
79
|
-
{ "include": "#operators" },
|
|
80
|
-
{ "include": "#brackets" }
|
|
302
|
+
{ "include": "#filter-union-content" }
|
|
81
303
|
]
|
|
82
304
|
},
|
|
83
305
|
{
|
|
84
|
-
"
|
|
306
|
+
"name": "meta.expression.filter.k",
|
|
85
307
|
"begin": "(\\?)\\s*(\\{)",
|
|
86
|
-
"end": "(\\})(?:\\s*(=)\\s*([a-zA-Z0-9_?!+\\-]
|
|
308
|
+
"end": "(\\})(?:\\s*(=)\\s*([a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*))?",
|
|
309
|
+
"beginCaptures": {
|
|
310
|
+
"1": { "name": "keyword.operator.filter.k" },
|
|
311
|
+
"2": { "name": "punctuation.section.filter.product.begin.k" }
|
|
312
|
+
},
|
|
313
|
+
"endCaptures": {
|
|
314
|
+
"1": { "name": "punctuation.section.filter.product.end.k" },
|
|
315
|
+
"2": { "name": "keyword.operator.binding.k" },
|
|
316
|
+
"3": { "name": "variable.other.pattern.k" }
|
|
317
|
+
},
|
|
318
|
+
"patterns": [
|
|
319
|
+
{ "include": "#filter-product-content" }
|
|
320
|
+
]
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"name": "meta.expression.filter.k",
|
|
324
|
+
"begin": "(\\?)\\s*(\\()",
|
|
325
|
+
"end": "(\\))(?:\\s*(=)\\s*([a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*))?",
|
|
87
326
|
"beginCaptures": {
|
|
88
327
|
"1": { "name": "keyword.operator.filter.k" },
|
|
89
|
-
"2": { "name": "punctuation.
|
|
328
|
+
"2": { "name": "punctuation.section.filter.any.begin.k" }
|
|
90
329
|
},
|
|
91
330
|
"endCaptures": {
|
|
92
|
-
"1": { "name": "punctuation.
|
|
93
|
-
"2": { "name": "keyword.operator.
|
|
331
|
+
"1": { "name": "punctuation.section.filter.any.end.k" },
|
|
332
|
+
"2": { "name": "keyword.operator.binding.k" },
|
|
94
333
|
"3": { "name": "variable.other.pattern.k" }
|
|
95
334
|
},
|
|
96
335
|
"patterns": [
|
|
97
|
-
{ "include": "#
|
|
98
|
-
{ "include": "#comment-line" },
|
|
99
|
-
{ "include": "#filter" },
|
|
100
|
-
{ "include": "#pattern-variable" },
|
|
101
|
-
{ "include": "#type-ref" },
|
|
102
|
-
{ "include": "#string-double" },
|
|
103
|
-
{ "include": "#string-single" },
|
|
104
|
-
{ "include": "#dots" },
|
|
105
|
-
{ "include": "#operators" },
|
|
106
|
-
{ "include": "#brackets" }
|
|
336
|
+
{ "include": "#filter-any-content" }
|
|
107
337
|
]
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"name": "meta.expression.filter.k",
|
|
341
|
+
"match": "(\\?)\\s*(\\$)\\s*(@)([a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*)",
|
|
342
|
+
"captures": {
|
|
343
|
+
"1": { "name": "keyword.operator.filter.k" },
|
|
344
|
+
"2": { "name": "keyword.operator.type.k" },
|
|
345
|
+
"3": { "name": "punctuation.definition.canonical.k" },
|
|
346
|
+
"4": { "name": "support.type.canonical.k" }
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"name": "meta.expression.filter.k",
|
|
351
|
+
"match": "(\\?)\\s*(\\$)\\s*([a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*)",
|
|
352
|
+
"captures": {
|
|
353
|
+
"1": { "name": "keyword.operator.filter.k" },
|
|
354
|
+
"2": { "name": "keyword.operator.type.k" },
|
|
355
|
+
"3": { "name": "support.type.k" }
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"name": "meta.expression.filter.k",
|
|
360
|
+
"match": "(\\?)\\s*([a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*)",
|
|
361
|
+
"captures": {
|
|
362
|
+
"1": { "name": "keyword.operator.filter.k" },
|
|
363
|
+
"2": { "name": "variable.other.pattern.k" }
|
|
364
|
+
}
|
|
108
365
|
}
|
|
109
366
|
]
|
|
110
367
|
},
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"
|
|
368
|
+
"filter-union": {
|
|
369
|
+
"name": "meta.expression.filter.k",
|
|
370
|
+
"begin": "(<)",
|
|
371
|
+
"end": "(>)(?:\\s*(=)\\s*([a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*))?",
|
|
372
|
+
"beginCaptures": {
|
|
373
|
+
"1": { "name": "punctuation.section.filter.union.begin.k" }
|
|
374
|
+
},
|
|
375
|
+
"endCaptures": {
|
|
376
|
+
"1": { "name": "punctuation.section.filter.union.end.k" },
|
|
377
|
+
"2": { "name": "keyword.operator.binding.k" },
|
|
378
|
+
"3": { "name": "variable.other.pattern.k" }
|
|
379
|
+
},
|
|
380
|
+
"patterns": [
|
|
381
|
+
{ "include": "#filter-union-content" }
|
|
382
|
+
]
|
|
116
383
|
},
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"1": { "name": "
|
|
123
|
-
|
|
124
|
-
|
|
384
|
+
"filter-product": {
|
|
385
|
+
"name": "meta.expression.filter.k",
|
|
386
|
+
"begin": "(\\{)",
|
|
387
|
+
"end": "(\\})(?:\\s*(=)\\s*([a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*))?",
|
|
388
|
+
"beginCaptures": {
|
|
389
|
+
"1": { "name": "punctuation.section.filter.product.begin.k" }
|
|
390
|
+
},
|
|
391
|
+
"endCaptures": {
|
|
392
|
+
"1": { "name": "punctuation.section.filter.product.end.k" },
|
|
393
|
+
"2": { "name": "keyword.operator.binding.k" },
|
|
394
|
+
"3": { "name": "variable.other.pattern.k" }
|
|
395
|
+
},
|
|
396
|
+
"patterns": [
|
|
397
|
+
{ "include": "#filter-product-content" }
|
|
398
|
+
]
|
|
125
399
|
},
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
"
|
|
129
|
-
"
|
|
130
|
-
"
|
|
400
|
+
"filter-any": {
|
|
401
|
+
"name": "meta.expression.filter.k",
|
|
402
|
+
"begin": "(\\()",
|
|
403
|
+
"end": "(\\))(?:\\s*(=)\\s*([a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*))?",
|
|
404
|
+
"beginCaptures": {
|
|
405
|
+
"1": { "name": "punctuation.section.filter.any.begin.k" }
|
|
406
|
+
},
|
|
407
|
+
"endCaptures": {
|
|
408
|
+
"1": { "name": "punctuation.section.filter.any.end.k" },
|
|
409
|
+
"2": { "name": "keyword.operator.binding.k" },
|
|
410
|
+
"3": { "name": "variable.other.pattern.k" }
|
|
411
|
+
},
|
|
412
|
+
"patterns": [
|
|
413
|
+
{ "include": "#filter-any-content" }
|
|
414
|
+
]
|
|
131
415
|
},
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
416
|
+
"filter-union-content": {
|
|
417
|
+
"patterns": [
|
|
418
|
+
{ "include": "#comment-block" },
|
|
419
|
+
{ "include": "#comment-line" },
|
|
420
|
+
{ "include": "#filter-tag" },
|
|
421
|
+
{ "include": "#filter-product" },
|
|
422
|
+
{ "include": "#filter-union" },
|
|
423
|
+
{ "include": "#filter-any" },
|
|
424
|
+
{ "include": "#filter-type-ref" },
|
|
425
|
+
{ "include": "#dots" },
|
|
426
|
+
{ "include": "#pattern-variable" },
|
|
427
|
+
{ "include": "#separator" }
|
|
428
|
+
]
|
|
429
|
+
},
|
|
430
|
+
"filter-product-content": {
|
|
431
|
+
"patterns": [
|
|
432
|
+
{ "include": "#comment-block" },
|
|
433
|
+
{ "include": "#comment-line" },
|
|
434
|
+
{ "include": "#filter-label" },
|
|
435
|
+
{ "include": "#filter-product" },
|
|
436
|
+
{ "include": "#filter-union" },
|
|
437
|
+
{ "include": "#filter-any" },
|
|
438
|
+
{ "include": "#filter-type-ref" },
|
|
439
|
+
{ "include": "#dots" },
|
|
440
|
+
{ "include": "#pattern-variable" },
|
|
441
|
+
{ "include": "#separator" }
|
|
442
|
+
]
|
|
443
|
+
},
|
|
444
|
+
"filter-any-content": {
|
|
445
|
+
"patterns": [
|
|
446
|
+
{ "include": "#comment-block" },
|
|
447
|
+
{ "include": "#comment-line" },
|
|
448
|
+
{ "include": "#dots" },
|
|
449
|
+
{ "include": "#separator" }
|
|
450
|
+
]
|
|
451
|
+
},
|
|
452
|
+
"filter-label": {
|
|
135
453
|
"patterns": [
|
|
136
454
|
{
|
|
137
|
-
"name": "
|
|
138
|
-
"match": "
|
|
455
|
+
"name": "entity.name.label.k",
|
|
456
|
+
"match": "[a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*(?=\\s*[,}])"
|
|
139
457
|
},
|
|
140
458
|
{
|
|
141
|
-
"
|
|
142
|
-
"
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
459
|
+
"name": "entity.name.label.k",
|
|
460
|
+
"match": "(?:\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*')(?=\\s*[,}])"
|
|
461
|
+
}
|
|
462
|
+
]
|
|
463
|
+
},
|
|
464
|
+
"filter-tag": {
|
|
465
|
+
"patterns": [
|
|
466
|
+
{
|
|
467
|
+
"name": "entity.name.tag.k",
|
|
468
|
+
"match": "[a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*(?=\\s*[,>])"
|
|
146
469
|
},
|
|
147
470
|
{
|
|
148
|
-
"
|
|
149
|
-
"
|
|
150
|
-
"beginCaptures": { "0": { "name": "keyword.operator.projection.k" } },
|
|
151
|
-
"endCaptures": { "0": { "name": "keyword.operator.projection.k" } },
|
|
152
|
-
"contentName": "string.quoted.single.k"
|
|
471
|
+
"name": "entity.name.tag.k",
|
|
472
|
+
"match": "(?:\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*')(?=\\s*[,>])"
|
|
153
473
|
}
|
|
154
474
|
]
|
|
155
475
|
},
|
|
156
|
-
|
|
157
|
-
"projection-slash": {
|
|
158
|
-
"comment": "/tag or /\"tag\" — union tag projection (assert and unwrap)",
|
|
476
|
+
"filter-type-ref": {
|
|
159
477
|
"patterns": [
|
|
160
478
|
{
|
|
161
|
-
"
|
|
162
|
-
"
|
|
479
|
+
"match": "(\\$)\\s*(@)([a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*)",
|
|
480
|
+
"captures": {
|
|
481
|
+
"1": { "name": "keyword.operator.type.k" },
|
|
482
|
+
"2": { "name": "punctuation.definition.canonical.k" },
|
|
483
|
+
"3": { "name": "support.type.canonical.k" }
|
|
484
|
+
}
|
|
163
485
|
},
|
|
164
486
|
{
|
|
165
|
-
"
|
|
166
|
-
"
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
487
|
+
"match": "(\\$)\\s*([a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*)",
|
|
488
|
+
"captures": {
|
|
489
|
+
"1": { "name": "keyword.operator.type.k" },
|
|
490
|
+
"2": { "name": "support.type.k" }
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
]
|
|
494
|
+
},
|
|
495
|
+
"pattern-variable": {
|
|
496
|
+
"name": "variable.other.pattern.k",
|
|
497
|
+
"match": "[a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*"
|
|
498
|
+
},
|
|
499
|
+
"projection-dot": {
|
|
500
|
+
"comment": ".label projects a product field",
|
|
501
|
+
"patterns": [
|
|
502
|
+
{
|
|
503
|
+
"match": "(\\.)([a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*)",
|
|
504
|
+
"captures": {
|
|
505
|
+
"1": { "name": "keyword.operator.projection.product.k" },
|
|
506
|
+
"2": { "name": "entity.name.label.k" }
|
|
507
|
+
}
|
|
170
508
|
},
|
|
171
509
|
{
|
|
172
|
-
"
|
|
173
|
-
"
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
510
|
+
"match": "(\\.)(\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*')",
|
|
511
|
+
"captures": {
|
|
512
|
+
"1": { "name": "keyword.operator.projection.product.k" },
|
|
513
|
+
"2": { "name": "entity.name.label.k" }
|
|
514
|
+
}
|
|
177
515
|
}
|
|
178
516
|
]
|
|
179
517
|
},
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
"comment": "|tag or |\"tag\" — variant (tagged union) introduction",
|
|
518
|
+
"projection-slash": {
|
|
519
|
+
"comment": "/tag asserts and unwraps a union variant",
|
|
183
520
|
"patterns": [
|
|
184
521
|
{
|
|
185
|
-
"
|
|
186
|
-
"
|
|
522
|
+
"match": "(/)([a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*)",
|
|
523
|
+
"captures": {
|
|
524
|
+
"1": { "name": "keyword.operator.projection.union.k" },
|
|
525
|
+
"2": { "name": "entity.name.tag.k" }
|
|
526
|
+
}
|
|
187
527
|
},
|
|
188
528
|
{
|
|
189
|
-
"
|
|
190
|
-
"
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
529
|
+
"match": "(/)(\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*')",
|
|
530
|
+
"captures": {
|
|
531
|
+
"1": { "name": "keyword.operator.projection.union.k" },
|
|
532
|
+
"2": { "name": "entity.name.tag.k" }
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
]
|
|
536
|
+
},
|
|
537
|
+
"variant-intro": {
|
|
538
|
+
"comment": "|tag or \\tag introduces a union variant",
|
|
539
|
+
"patterns": [
|
|
540
|
+
{
|
|
541
|
+
"match": "([|\\\\])([a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*)",
|
|
542
|
+
"captures": {
|
|
543
|
+
"1": { "name": "keyword.operator.variant.k" },
|
|
544
|
+
"2": { "name": "entity.name.tag.k" }
|
|
545
|
+
}
|
|
194
546
|
},
|
|
195
547
|
{
|
|
196
|
-
"
|
|
197
|
-
"
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
548
|
+
"match": "([|\\\\])(\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*')",
|
|
549
|
+
"captures": {
|
|
550
|
+
"1": { "name": "keyword.operator.variant.k" },
|
|
551
|
+
"2": { "name": "entity.name.tag.k" }
|
|
552
|
+
}
|
|
201
553
|
}
|
|
202
554
|
]
|
|
203
555
|
},
|
|
204
|
-
|
|
556
|
+
"canonical-function-ref": {
|
|
557
|
+
"match": "(@)([a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*)",
|
|
558
|
+
"captures": {
|
|
559
|
+
"1": { "name": "punctuation.definition.canonical.k" },
|
|
560
|
+
"2": { "name": "support.function.canonical.k" }
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
"relation-identifier": {
|
|
564
|
+
"name": "support.function.identifier.k",
|
|
565
|
+
"match": "[a-zA-Z0-9_+\\-][a-zA-Z0-9_?!+\\-]*"
|
|
566
|
+
},
|
|
205
567
|
"string-double": {
|
|
206
568
|
"name": "string.quoted.double.k",
|
|
207
569
|
"begin": "\"",
|
|
208
570
|
"end": "\"",
|
|
209
571
|
"patterns": [
|
|
210
572
|
{ "name": "constant.character.escape.k", "match": "\\\\(?:[\"\\\\/bfnrt]|u[0-9a-fA-F]{4})" },
|
|
211
|
-
{ "name": "invalid.illegal.escape.k",
|
|
573
|
+
{ "name": "invalid.illegal.escape.k", "match": "\\\\." }
|
|
212
574
|
]
|
|
213
575
|
},
|
|
214
|
-
|
|
215
576
|
"string-single": {
|
|
216
577
|
"name": "string.quoted.single.k",
|
|
217
578
|
"begin": "'",
|
|
218
579
|
"end": "'",
|
|
219
580
|
"patterns": [
|
|
220
581
|
{ "name": "constant.character.escape.k", "match": "\\\\(?:['\\\\/bfnrt]|u[0-9a-fA-F]{4})" },
|
|
221
|
-
{ "name": "invalid.illegal.escape.k",
|
|
582
|
+
{ "name": "invalid.illegal.escape.k", "match": "\\\\." }
|
|
222
583
|
]
|
|
223
584
|
},
|
|
224
|
-
|
|
225
585
|
"dots": {
|
|
226
|
-
"comment": "...
|
|
227
|
-
"name": "constant.language.k",
|
|
586
|
+
"comment": "... is the any/open pattern marker",
|
|
587
|
+
"name": "constant.language.any.k",
|
|
228
588
|
"match": "\\.\\.\\."
|
|
229
589
|
},
|
|
230
|
-
|
|
231
|
-
"operators": {
|
|
232
|
-
"comment": "= ; , : ~ — structural separators and definition operators",
|
|
590
|
+
"separator": {
|
|
233
591
|
"name": "punctuation.separator.k",
|
|
234
|
-
"match": "[
|
|
592
|
+
"match": "[=;,:~]"
|
|
235
593
|
},
|
|
236
|
-
|
|
237
594
|
"brackets": {
|
|
238
|
-
"comment": "{ } ( ) < > — grouping and combinator delimiters",
|
|
239
595
|
"name": "punctuation.brackets.k",
|
|
240
596
|
"match": "[{}()<>]"
|
|
241
597
|
}
|