@cavelang/tree-sitter-cave 0.20.0 → 0.27.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/grammar.js +7 -2
- package/package.json +1 -1
- package/src/grammar.json +65 -23
- package/src/node-types.json +4 -0
- package/src/parser.c +845 -735
- package/tree-sitter-cave.wasm +0 -0
package/grammar.js
CHANGED
|
@@ -79,8 +79,13 @@ module.exports = grammar({
|
|
|
79
79
|
field('value', choice($.value, $._term))
|
|
80
80
|
),
|
|
81
81
|
|
|
82
|
-
// `20B USD/yr`, `30ms`, `~1000 req/s`, `2026-Q1` — number then unit
|
|
83
|
-
|
|
82
|
+
// `20B USD/yr`, `30ms`, `~1000 req/s`, `2026-Q1` — number then unit
|
|
83
|
+
// (§7.1) — optionally `-> number [unit]`, a trajectory (§32.3).
|
|
84
|
+
value: $ => prec.right(seq(
|
|
85
|
+
$.number,
|
|
86
|
+
optional(alias($.entity, $.unit)),
|
|
87
|
+
optional(seq('->', $.number, optional(alias($.entity, $.unit))))
|
|
88
|
+
)),
|
|
84
89
|
|
|
85
90
|
object: $ => choice(
|
|
86
91
|
$.string,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cavelang/tree-sitter-cave",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.3",
|
|
4
4
|
"description": "Tree-sitter grammar for CAVE — the canonical grammar artifact behind editor and terminal highlighting.",
|
|
5
5
|
"license": "CC0-1.0",
|
|
6
6
|
"author": "Mirek Rusin (https://github.com/mirek)",
|
package/src/grammar.json
CHANGED
|
@@ -346,30 +346,72 @@
|
|
|
346
346
|
]
|
|
347
347
|
},
|
|
348
348
|
"value": {
|
|
349
|
-
"type": "
|
|
350
|
-
"
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
"
|
|
349
|
+
"type": "PREC_RIGHT",
|
|
350
|
+
"value": 0,
|
|
351
|
+
"content": {
|
|
352
|
+
"type": "SEQ",
|
|
353
|
+
"members": [
|
|
354
|
+
{
|
|
355
|
+
"type": "SYMBOL",
|
|
356
|
+
"name": "number"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"type": "CHOICE",
|
|
360
|
+
"members": [
|
|
361
|
+
{
|
|
362
|
+
"type": "ALIAS",
|
|
363
|
+
"content": {
|
|
364
|
+
"type": "SYMBOL",
|
|
365
|
+
"name": "entity"
|
|
366
|
+
},
|
|
367
|
+
"named": true,
|
|
368
|
+
"value": "unit"
|
|
363
369
|
},
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
370
|
+
{
|
|
371
|
+
"type": "BLANK"
|
|
372
|
+
}
|
|
373
|
+
]
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"type": "CHOICE",
|
|
377
|
+
"members": [
|
|
378
|
+
{
|
|
379
|
+
"type": "SEQ",
|
|
380
|
+
"members": [
|
|
381
|
+
{
|
|
382
|
+
"type": "STRING",
|
|
383
|
+
"value": "->"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"type": "SYMBOL",
|
|
387
|
+
"name": "number"
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"type": "CHOICE",
|
|
391
|
+
"members": [
|
|
392
|
+
{
|
|
393
|
+
"type": "ALIAS",
|
|
394
|
+
"content": {
|
|
395
|
+
"type": "SYMBOL",
|
|
396
|
+
"name": "entity"
|
|
397
|
+
},
|
|
398
|
+
"named": true,
|
|
399
|
+
"value": "unit"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"type": "BLANK"
|
|
403
|
+
}
|
|
404
|
+
]
|
|
405
|
+
}
|
|
406
|
+
]
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"type": "BLANK"
|
|
410
|
+
}
|
|
411
|
+
]
|
|
412
|
+
}
|
|
413
|
+
]
|
|
414
|
+
}
|
|
373
415
|
},
|
|
374
416
|
"object": {
|
|
375
417
|
"type": "CHOICE",
|