@cavelang/tree-sitter-cave 0.22.0 → 0.27.14

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 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 (§7.1).
83
- value: $ => seq($.number, optional(alias($.entity, $.unit))),
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.22.0",
3
+ "version": "0.27.14",
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": "SEQ",
350
- "members": [
351
- {
352
- "type": "SYMBOL",
353
- "name": "number"
354
- },
355
- {
356
- "type": "CHOICE",
357
- "members": [
358
- {
359
- "type": "ALIAS",
360
- "content": {
361
- "type": "SYMBOL",
362
- "name": "entity"
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
- "named": true,
365
- "value": "unit"
366
- },
367
- {
368
- "type": "BLANK"
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",
@@ -549,6 +549,10 @@
549
549
  "type": "+/-",
550
550
  "named": false
551
551
  },
552
+ {
553
+ "type": "->",
554
+ "named": false
555
+ },
552
556
  {
553
557
  "type": ":",
554
558
  "named": false