@formulavize/lezer-fiz 2.3.1 → 2.3.3

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/test/styling.txt DELETED
@@ -1,388 +0,0 @@
1
- # Empty Call StyleArgList
2
-
3
- f(){}
4
-
5
- ==>
6
-
7
- Recipe(
8
- Call(Identifier, ArgList, StyleArgList)
9
- )
10
-
11
- # Empty Variable StyleArgList
12
-
13
- x{ } = f()
14
-
15
- ==>
16
-
17
- Recipe(
18
- Assignment(
19
- LhsVariable(Identifier, StyleArgList),
20
- Eq,
21
- Call(Identifier, ArgList)
22
- )
23
- )
24
-
25
- # Styled and Unstyled Unpacked Assignment
26
-
27
- x{}, y{} = z()
28
- a{}, b = c()
29
- i, j{} = k()
30
-
31
- ==>
32
-
33
- Recipe(
34
- Assignment(
35
- LhsVariable(Identifier, StyleArgList),
36
- LhsVariable(Identifier, StyleArgList),
37
- Eq,
38
- Call(Identifier, ArgList)
39
- )
40
- Assignment(
41
- LhsVariable(Identifier, StyleArgList),
42
- LhsVariable(Identifier),
43
- Eq,
44
- Call(Identifier, ArgList)
45
- )
46
- Assignment(
47
- LhsVariable(Identifier),
48
- LhsVariable(Identifier, StyleArgList),
49
- Eq,
50
- Call(Identifier, ArgList)
51
- )
52
- )
53
-
54
- # Style StringLiteral ending with }
55
-
56
- f(){num: "abc"}
57
-
58
- ==>
59
-
60
- Recipe(
61
- Call(
62
- Identifier,
63
- ArgList,
64
- StyleArgList(StyleDeclaration(PropertyName, StringLiteral))
65
- )
66
- )
67
-
68
- # Style ColorLiteral ending with ;
69
-
70
- f(){
71
- color: #1234;
72
- color: #7f7f7f;
73
- }
74
-
75
- ==>
76
-
77
- Recipe(
78
- Call(
79
- Identifier,
80
- ArgList,
81
- StyleArgList(
82
- StyleDeclaration(PropertyName, ColorLiteral),
83
- StyleDeclaration(PropertyName, ColorLiteral)
84
- )
85
- )
86
- )
87
-
88
- # Style NumberLiteral ending with newlines
89
-
90
- f(){
91
- a: 123
92
- b: 1.2%
93
- c: 3em
94
- margin: 10E2px
95
- margin: -456.7px
96
- margin: -0.0px
97
- }
98
-
99
- ==>
100
-
101
- Recipe(
102
- Call(
103
- Identifier,
104
- ArgList,
105
- StyleArgList(
106
- StyleDeclaration(PropertyName, NumberLiteral),
107
- StyleDeclaration(PropertyName, NumberLiteral(Unit)),
108
- StyleDeclaration(PropertyName, NumberLiteral(Unit)),
109
- StyleDeclaration(PropertyName, NumberLiteral(Unit)),
110
- StyleDeclaration(PropertyName, NumberLiteral(Unit)),
111
- StyleDeclaration(PropertyName, NumberLiteral(Unit))
112
- )
113
- )
114
- )
115
-
116
-
117
- # StyleTag Used
118
-
119
- f(){
120
- #one #two
121
- }
122
-
123
- ==>
124
-
125
- Recipe(
126
- Call(
127
- Identifier,
128
- ArgList,
129
- StyleArgList(
130
- StyleTag(QualifiableIdentifier(Identifier)),
131
- StyleTag(QualifiableIdentifier(Identifier))
132
- )
133
- )
134
- )
135
-
136
- # Empty StyleTag Declared
137
-
138
- #empty{}
139
-
140
- ==>
141
-
142
- Recipe(
143
- StyleTagDeclaration(
144
- Identifier,
145
- StyleArgList()
146
- )
147
- )
148
-
149
- # Nested StyleTags
150
-
151
- #mystyle{
152
- #a
153
- x: "y"
154
- #c
155
- }
156
-
157
- ==>
158
-
159
- Recipe(
160
- StyleTagDeclaration(
161
- Identifier,
162
- StyleArgList(
163
- StyleTag(QualifiableIdentifier(Identifier)),
164
- StyleDeclaration(PropertyName, StringLiteral),
165
- StyleTag(QualifiableIdentifier(Identifier))
166
- )
167
- )
168
- )
169
-
170
- # StyleMap Value List
171
-
172
- #mystyle{
173
- a:1,2
174
- b:3px, 4, #123, "text"
175
- }
176
-
177
- ==>
178
-
179
- Recipe(
180
- StyleTagDeclaration(
181
- Identifier,
182
- StyleArgList(
183
- StyleDeclaration(PropertyName, NumberLiteral, NumberLiteral)
184
- StyleDeclaration(
185
- PropertyName,
186
- NumberLiteral(Unit),
187
- NumberLiteral,
188
- ColorLiteral,
189
- StringLiteral
190
- )
191
- )
192
- )
193
- )
194
-
195
- # PropertyName Cases
196
-
197
- #cases{
198
- snek_case: "hiss"
199
- kebab-case: "🍢"
200
- camelCase: "has 1 hump"
201
- PascalCase: "has 2 humps"
202
- LOUD_SNEK_CASE: "HISS!"
203
- }
204
-
205
- ==>
206
-
207
- Recipe(
208
- StyleTagDeclaration(
209
- Identifier,
210
- StyleArgList(
211
- StyleDeclaration(PropertyName, StringLiteral),
212
- StyleDeclaration(PropertyName, StringLiteral),
213
- StyleDeclaration(PropertyName, StringLiteral),
214
- StyleDeclaration(PropertyName, StringLiteral),
215
- StyleDeclaration(PropertyName, StringLiteral),
216
- )
217
- )
218
- )
219
-
220
- # Style Binding with StyleTags
221
-
222
- %a{}
223
- %b{
224
- #x #y
225
- }
226
-
227
- ==>
228
-
229
- Recipe(
230
- StyleBinding(Identifier, StyleArgList())
231
- StyleBinding(
232
- Identifier,
233
- StyleArgList(
234
- StyleTag(QualifiableIdentifier(Identifier))
235
- StyleTag(QualifiableIdentifier(Identifier)),
236
- )
237
- )
238
- )
239
-
240
- # Style Binding with Style Declarations
241
-
242
- %c{
243
- color: #ff0000
244
- font-size: 12px
245
- }
246
-
247
- ==>
248
-
249
- Recipe(
250
- StyleBinding(
251
- Identifier,
252
- StyleArgList(
253
- StyleDeclaration(PropertyName, ColorLiteral),
254
- StyleDeclaration(PropertyName, NumberLiteral(Unit))
255
- )
256
- )
257
- )
258
-
259
- # Style Binding with StringLiteral
260
-
261
- %d{
262
- "description"
263
- }
264
-
265
- ==>
266
-
267
- Recipe(
268
- StyleBinding(
269
- Identifier,
270
- StyleArgList(StringLiteral)
271
- )
272
- )
273
-
274
- # Style Binding Mixed Content
275
-
276
- %e{
277
- #base
278
- color: #abc
279
- "note"
280
- }
281
-
282
- ==>
283
-
284
- Recipe(
285
- StyleBinding(
286
- Identifier,
287
- StyleArgList(
288
- StyleTag(QualifiableIdentifier(Identifier)),
289
- StyleDeclaration(PropertyName, ColorLiteral),
290
- StringLiteral
291
- )
292
- )
293
- )
294
-
295
- # Global Style Binding with StyleTags
296
-
297
- *nodes{}
298
- *edges{
299
- #x #y
300
- }
301
-
302
- ==>
303
-
304
- Recipe(
305
- GlobalStyleBinding(Identifier, StyleArgList())
306
- GlobalStyleBinding(
307
- Identifier,
308
- StyleArgList(
309
- StyleTag(QualifiableIdentifier(Identifier))
310
- StyleTag(QualifiableIdentifier(Identifier)),
311
- )
312
- )
313
- )
314
-
315
- # Global Style Binding with Style Declarations
316
-
317
- *nodes{
318
- color: #ff0000
319
- font-size: 12px
320
- }
321
-
322
- ==>
323
-
324
- Recipe(
325
- GlobalStyleBinding(
326
- Identifier,
327
- StyleArgList(
328
- StyleDeclaration(PropertyName, ColorLiteral),
329
- StyleDeclaration(PropertyName, NumberLiteral(Unit))
330
- )
331
- )
332
- )
333
-
334
- # Global Style Binding with StringLiteral
335
-
336
- *nodes{
337
- "description"
338
- }
339
-
340
- ==>
341
-
342
- Recipe(
343
- GlobalStyleBinding(
344
- Identifier,
345
- StyleArgList(StringLiteral)
346
- )
347
- )
348
-
349
- # Global Style Binding Mixed Content
350
-
351
- *nodes{
352
- #base
353
- color: #abc
354
- "note"
355
- }
356
-
357
- ==>
358
-
359
- Recipe(
360
- GlobalStyleBinding(
361
- Identifier,
362
- StyleArgList(
363
- StyleTag(QualifiableIdentifier(Identifier)),
364
- StyleDeclaration(PropertyName, ColorLiteral),
365
- StringLiteral
366
- )
367
- )
368
- )
369
-
370
- # Description Shortcut
371
-
372
- #a{
373
- test: "string"
374
- "description"
375
- 'shortcut'
376
- }
377
- ==>
378
-
379
- Recipe(
380
- StyleTagDeclaration(
381
- Identifier,
382
- StyleArgList(
383
- StyleDeclaration(PropertyName, StringLiteral),
384
- StringLiteral,
385
- StringLiteral,
386
- )
387
- )
388
- )
package/test/test-fiz.js DELETED
@@ -1,20 +0,0 @@
1
- import { parser } from "../dist/index.es.js";
2
- import { fileTests } from "@lezer/generator/dist/test";
3
-
4
- import fs from "fs";
5
- import path from "path";
6
- import { fileURLToPath } from "url";
7
- let caseDir = path.dirname(fileURLToPath(import.meta.url));
8
-
9
- for (let file of fs.readdirSync(caseDir)) {
10
- if (file === "test-fiz.js") continue;
11
-
12
- let name = /^[^\.]*/.exec(file)[0];
13
- describe(name, () => {
14
- for (let { name, run } of fileTests(
15
- fs.readFileSync(path.join(caseDir, file), "utf8"),
16
- file,
17
- ))
18
- it(name, () => run(parser));
19
- });
20
- }