cddl 0.16.0 → 0.18.0

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 (44) hide show
  1. package/LICENSE +1 -1
  2. package/package.json +5 -1
  3. package/.release-it.ts +0 -10
  4. package/docs/README.md +0 -47
  5. package/docs/arrays.md +0 -356
  6. package/docs/ast-structure.md +0 -166
  7. package/docs/basic-types.md +0 -243
  8. package/docs/cddl-cheatsheet.md +0 -231
  9. package/docs/comments.md +0 -307
  10. package/docs/groups.md +0 -351
  11. package/docs/operators.md +0 -466
  12. package/docs/properties.md +0 -334
  13. package/docs/ranges.md +0 -339
  14. package/docs/references.md +0 -340
  15. package/docs/variables.md +0 -335
  16. package/src/ast.ts +0 -180
  17. package/src/cli/commands/repl.ts +0 -33
  18. package/src/cli/commands/validate.ts +0 -44
  19. package/src/cli/constants.ts +0 -1
  20. package/src/cli/index.ts +0 -18
  21. package/src/constants.ts +0 -16
  22. package/src/index.ts +0 -12
  23. package/src/lexer.ts +0 -238
  24. package/src/parser.ts +0 -993
  25. package/src/tokens.ts +0 -50
  26. package/src/utils.ts +0 -96
  27. package/tests/__snapshots__/complex_types.test.ts.snap +0 -80
  28. package/tests/__snapshots__/examples.test.ts.snap +0 -1077
  29. package/tests/__snapshots__/group-choices.test.ts.snap +0 -403
  30. package/tests/__snapshots__/parser.test.ts.snap +0 -3045
  31. package/tests/__snapshots__/webdriver-local.test.ts.snap +0 -11192
  32. package/tests/__snapshots__/webdriver-remote.test.ts.snap +0 -16350
  33. package/tests/commands/repl.test.ts +0 -52
  34. package/tests/commands/validate.test.ts +0 -66
  35. package/tests/complex_types.test.ts +0 -18
  36. package/tests/examples.test.ts +0 -25
  37. package/tests/group-choices.test.ts +0 -132
  38. package/tests/lexer.test.ts +0 -63
  39. package/tests/module.test.ts +0 -21
  40. package/tests/parser.test.ts +0 -63
  41. package/tests/utils.test.ts +0 -211
  42. package/tests/webdriver-local.test.ts +0 -15
  43. package/tests/webdriver-remote.test.ts +0 -15
  44. package/tsconfig.json +0 -11
@@ -1,403 +0,0 @@
1
- // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
-
3
- exports[`Group Choice Parsing > Blocks with Braces > should parse bare group inside brace 1`] = `
4
- [
5
- {
6
- "Comments": [],
7
- "IsChoiceAddition": false,
8
- "Name": "myrule",
9
- "Properties": [
10
- {
11
- "Comments": [],
12
- "HasCut": false,
13
- "Name": "",
14
- "Occurrence": {
15
- "m": 1,
16
- "n": 1,
17
- },
18
- "Type": "int",
19
- },
20
- ],
21
- "Type": "group",
22
- },
23
- ]
24
- `;
25
-
26
- exports[`Group Choice Parsing > Blocks with Braces > should parse nested group inside map 1`] = `
27
- [
28
- {
29
- "Comments": [],
30
- "IsChoiceAddition": false,
31
- "Name": "myrule",
32
- "Properties": [
33
- {
34
- "Comments": [],
35
- "HasCut": false,
36
- "Name": "",
37
- "Occurrence": {
38
- "m": 1,
39
- "n": 1,
40
- },
41
- "Type": "int",
42
- },
43
- ],
44
- "Type": "group",
45
- },
46
- ]
47
- `;
48
-
49
- exports[`Group Choice Parsing > Group Choice (//) > should parse group choice with multiple items 1`] = `
50
- [
51
- {
52
- "Comments": [],
53
- "IsChoiceAddition": false,
54
- "Name": "mygroup",
55
- "Properties": [
56
- {
57
- "Comments": [],
58
- "HasCut": false,
59
- "Name": "",
60
- "Occurrence": {
61
- "m": 1,
62
- "n": 1,
63
- },
64
- "Type": "int",
65
- },
66
- [
67
- {
68
- "Comments": [],
69
- "HasCut": false,
70
- "Name": "",
71
- "Occurrence": {
72
- "m": 1,
73
- "n": 1,
74
- },
75
- "Type": {
76
- "Type": "group",
77
- "Unwrapped": false,
78
- "Value": "text",
79
- },
80
- },
81
- ],
82
- {
83
- "Comments": [],
84
- "HasCut": false,
85
- "Name": "",
86
- "Occurrence": {
87
- "m": 1,
88
- "n": 1,
89
- },
90
- "Type": "float",
91
- },
92
- ],
93
- "Type": "group",
94
- },
95
- ]
96
- `;
97
-
98
- exports[`Group Choice Parsing > Group Choice (//) > should parse nested group choice 1`] = `
99
- [
100
- {
101
- "Comments": [],
102
- "IsChoiceAddition": false,
103
- "Name": "mygroup",
104
- "Properties": [
105
- {
106
- "Comments": [],
107
- "HasCut": false,
108
- "Name": "",
109
- "Occurrence": {
110
- "m": 1,
111
- "n": 1,
112
- },
113
- "Type": {
114
- "Comments": [],
115
- "IsChoiceAddition": false,
116
- "Name": "",
117
- "Properties": [
118
- [
119
- {
120
- "Comments": [],
121
- "HasCut": false,
122
- "Name": "",
123
- "Occurrence": {
124
- "m": 1,
125
- "n": 1,
126
- },
127
- "Type": {
128
- "Type": "group",
129
- "Unwrapped": false,
130
- "Value": "int",
131
- },
132
- },
133
- ],
134
- {
135
- "Comments": [],
136
- "HasCut": false,
137
- "Name": "",
138
- "Occurrence": {
139
- "m": 1,
140
- "n": 1,
141
- },
142
- "Type": "text",
143
- },
144
- ],
145
- "Type": "group",
146
- },
147
- },
148
- ],
149
- "Type": "group",
150
- },
151
- ]
152
- `;
153
-
154
- exports[`Group Choice Parsing > Group Choice (//) > should verify group choice operator // 1`] = `
155
- [
156
- {
157
- "Comments": [],
158
- "IsChoiceAddition": false,
159
- "Name": "mygroup",
160
- "Properties": [
161
- [
162
- {
163
- "Comments": [],
164
- "HasCut": false,
165
- "Name": "",
166
- "Occurrence": {
167
- "m": 1,
168
- "n": 1,
169
- },
170
- "Type": {
171
- "Type": "group",
172
- "Unwrapped": false,
173
- "Value": "int",
174
- },
175
- },
176
- ],
177
- {
178
- "Comments": [],
179
- "HasCut": false,
180
- "Name": "",
181
- "Occurrence": {
182
- "m": 1,
183
- "n": 1,
184
- },
185
- "Type": "text",
186
- },
187
- ],
188
- "Type": "group",
189
- },
190
- ]
191
- `;
192
-
193
- exports[`Group Choice Parsing > Map Group Choice > should parse group choice inside map 1`] = `
194
- [
195
- {
196
- "Comments": [],
197
- "IsChoiceAddition": false,
198
- "Name": "mymap",
199
- "Properties": [
200
- [
201
- {
202
- "Comments": [],
203
- "HasCut": false,
204
- "Name": "a",
205
- "Occurrence": {
206
- "m": 1,
207
- "n": 1,
208
- },
209
- "Type": [
210
- {
211
- "Type": "literal",
212
- "Unwrapped": false,
213
- "Value": 1,
214
- },
215
- ],
216
- },
217
- {
218
- "Comments": [],
219
- "HasCut": false,
220
- "Name": "b",
221
- "Occurrence": {
222
- "m": 1,
223
- "n": 1,
224
- },
225
- "Type": [
226
- {
227
- "Type": "literal",
228
- "Unwrapped": false,
229
- "Value": 2,
230
- },
231
- ],
232
- },
233
- ],
234
- ],
235
- "Type": "group",
236
- },
237
- ]
238
- `;
239
-
240
- exports[`Group Choice Parsing > Type Choice (/) > should correctly handle slash in mixed context 1`] = `
241
- [
242
- {
243
- "Comments": [],
244
- "Name": "myrule",
245
- "Type": "array",
246
- "Values": [
247
- {
248
- "Comments": [],
249
- "HasCut": false,
250
- "Name": "",
251
- "Occurrence": {
252
- "m": 1,
253
- "n": 1,
254
- },
255
- "Type": [
256
- "int",
257
- "text",
258
- ],
259
- },
260
- ],
261
- },
262
- ]
263
- `;
264
-
265
- exports[`Group Choice Parsing > Type Choice (/) > should parse inline array alternatives inside map properties 1`] = `
266
- [
267
- {
268
- "Comments": [],
269
- "IsChoiceAddition": false,
270
- "Name": "StorePutParams",
271
- "Properties": [
272
- {
273
- "Comments": [],
274
- "HasCut": true,
275
- "Name": "storeNamespace",
276
- "Occurrence": {
277
- "m": 1,
278
- "n": 1,
279
- },
280
- "Type": [
281
- {
282
- "Comments": [],
283
- "Name": "",
284
- "Type": "array",
285
- "Values": [
286
- {
287
- "Comments": [],
288
- "HasCut": false,
289
- "Name": "",
290
- "Occurrence": {
291
- "m": Infinity,
292
- "n": 0,
293
- },
294
- "Type": "text",
295
- },
296
- ],
297
- },
298
- ],
299
- },
300
- {
301
- "Comments": [],
302
- "HasCut": true,
303
- "Name": "key",
304
- "Occurrence": {
305
- "m": 1,
306
- "n": 1,
307
- },
308
- "Type": [
309
- "text",
310
- ],
311
- },
312
- {
313
- "Comments": [],
314
- "HasCut": true,
315
- "Name": "value",
316
- "Occurrence": {
317
- "m": 1,
318
- "n": 1,
319
- },
320
- "Type": [
321
- {
322
- "Comments": [],
323
- "IsChoiceAddition": false,
324
- "Name": "",
325
- "Properties": [
326
- {
327
- "Comments": [],
328
- "HasCut": false,
329
- "Name": "text",
330
- "Occurrence": {
331
- "m": Infinity,
332
- "n": 0,
333
- },
334
- "Type": [
335
- "any",
336
- ],
337
- },
338
- ],
339
- "Type": "group",
340
- },
341
- ],
342
- },
343
- {
344
- "Comments": [],
345
- "HasCut": true,
346
- "Name": "index",
347
- "Occurrence": {
348
- "m": Infinity,
349
- "n": 0,
350
- },
351
- "Type": [
352
- "bool",
353
- {
354
- "Comments": [],
355
- "Name": "",
356
- "Type": "array",
357
- "Values": [
358
- {
359
- "Comments": [],
360
- "HasCut": false,
361
- "Name": "",
362
- "Occurrence": {
363
- "m": Infinity,
364
- "n": 0,
365
- },
366
- "Type": "text",
367
- },
368
- ],
369
- },
370
- ],
371
- },
372
- {
373
- "Comments": [],
374
- "HasCut": true,
375
- "Name": "ttl",
376
- "Occurrence": {
377
- "m": Infinity,
378
- "n": 0,
379
- },
380
- "Type": [
381
- "uint",
382
- ],
383
- },
384
- ],
385
- "Type": "group",
386
- },
387
- ]
388
- `;
389
-
390
- exports[`Group Choice Parsing > Type Choice (/) > should parse type choice inside group 1`] = `
391
- [
392
- {
393
- "Comments": [],
394
- "IsChoiceAddition": false,
395
- "Name": "mygroup",
396
- "PropertyType": [
397
- "int",
398
- "text",
399
- ],
400
- "Type": "variable",
401
- },
402
- ]
403
- `;