cddl 0.15.0 → 0.17.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 (46) hide show
  1. package/LICENSE +1 -1
  2. package/build/parser.d.ts.map +1 -1
  3. package/build/parser.js +26 -2
  4. package/package.json +5 -1
  5. package/.release-it.ts +0 -10
  6. package/docs/README.md +0 -47
  7. package/docs/arrays.md +0 -356
  8. package/docs/ast-structure.md +0 -166
  9. package/docs/basic-types.md +0 -243
  10. package/docs/cddl-cheatsheet.md +0 -231
  11. package/docs/comments.md +0 -307
  12. package/docs/groups.md +0 -351
  13. package/docs/operators.md +0 -466
  14. package/docs/properties.md +0 -334
  15. package/docs/ranges.md +0 -339
  16. package/docs/references.md +0 -340
  17. package/docs/variables.md +0 -335
  18. package/src/ast.ts +0 -180
  19. package/src/cli/commands/repl.ts +0 -33
  20. package/src/cli/commands/validate.ts +0 -44
  21. package/src/cli/constants.ts +0 -1
  22. package/src/cli/index.ts +0 -18
  23. package/src/constants.ts +0 -16
  24. package/src/index.ts +0 -12
  25. package/src/lexer.ts +0 -238
  26. package/src/parser.ts +0 -967
  27. package/src/tokens.ts +0 -50
  28. package/src/utils.ts +0 -96
  29. package/tests/__snapshots__/complex_types.test.ts.snap +0 -80
  30. package/tests/__snapshots__/examples.test.ts.snap +0 -1077
  31. package/tests/__snapshots__/group-choices.test.ts.snap +0 -278
  32. package/tests/__snapshots__/parser.test.ts.snap +0 -3045
  33. package/tests/__snapshots__/webdriver-local.test.ts.snap +0 -11192
  34. package/tests/__snapshots__/webdriver-remote.test.ts.snap +0 -16350
  35. package/tests/commands/repl.test.ts +0 -52
  36. package/tests/commands/validate.test.ts +0 -66
  37. package/tests/complex_types.test.ts +0 -18
  38. package/tests/examples.test.ts +0 -25
  39. package/tests/group-choices.test.ts +0 -103
  40. package/tests/lexer.test.ts +0 -63
  41. package/tests/module.test.ts +0 -21
  42. package/tests/parser.test.ts +0 -44
  43. package/tests/utils.test.ts +0 -211
  44. package/tests/webdriver-local.test.ts +0 -15
  45. package/tests/webdriver-remote.test.ts +0 -15
  46. package/tsconfig.json +0 -11
@@ -1,278 +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 type choice inside group 1`] = `
266
- [
267
- {
268
- "Comments": [],
269
- "IsChoiceAddition": false,
270
- "Name": "mygroup",
271
- "PropertyType": [
272
- "int",
273
- "text",
274
- ],
275
- "Type": "variable",
276
- },
277
- ]
278
- `;