tree-sitter-bynk 0.120.0 → 0.132.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.
- package/grammar.js +25 -1
- package/package.json +1 -1
- package/queries/highlights.scm +1 -0
- package/src/grammar.json +120 -0
- package/src/node-types.json +202 -0
- package/src/parser.c +44459 -33131
package/grammar.js
CHANGED
|
@@ -541,9 +541,24 @@ module.exports = grammar({
|
|
|
541
541
|
field("name", $.identifier),
|
|
542
542
|
optional(field("protocol", $.service_protocol)),
|
|
543
543
|
"{",
|
|
544
|
+
// v0.131 (ADR 0158): the optional `cors { }` policy, in header position
|
|
545
|
+
// before the handlers (a `from http` concern; the checker restricts it).
|
|
546
|
+
optional(field("cors", $.cors_policy)),
|
|
544
547
|
repeat($.handler),
|
|
545
548
|
"}",
|
|
546
549
|
),
|
|
550
|
+
// v0.131: `cors { <name>: <value>, … }`. `cors` is a contextual keyword (like
|
|
551
|
+
// `store`/`key` — also a valid identifier); field names are ordinary
|
|
552
|
+
// identifiers matched against the closed set by the checker.
|
|
553
|
+
cors_policy: ($) =>
|
|
554
|
+
seq(
|
|
555
|
+
"cors",
|
|
556
|
+
"{",
|
|
557
|
+
repeat(seq($.cors_field, optional(","))),
|
|
558
|
+
"}",
|
|
559
|
+
),
|
|
560
|
+
cors_field: ($) =>
|
|
561
|
+
seq(field("name", $.identifier), ":", field("value", $._expression)),
|
|
547
562
|
// v0.44: `from <protocol>` on the service header.
|
|
548
563
|
// v0.103: `from WebSocket(in: I, out: O)` binds the inbound/outbound frame
|
|
549
564
|
// types. `WebSocket`, `in`, and `out` are contextual (resolved by `word`).
|
|
@@ -1044,8 +1059,17 @@ module.exports = grammar({
|
|
|
1044
1059
|
),
|
|
1045
1060
|
),
|
|
1046
1061
|
|
|
1047
|
-
_pattern: ($) =>
|
|
1062
|
+
_pattern: ($) =>
|
|
1063
|
+
choice($.wildcard_pattern, $.literal_pattern, $.variant_pattern),
|
|
1048
1064
|
wildcard_pattern: () => "_",
|
|
1065
|
+
// v0.130 §2.3.4: a literal pattern — an integer (optionally negated), a
|
|
1066
|
+
// string, or a boolean. A closed set (ADR 0001); no `Float`, no `()`.
|
|
1067
|
+
literal_pattern: ($) =>
|
|
1068
|
+
choice(
|
|
1069
|
+
seq(optional("-"), $.number_literal),
|
|
1070
|
+
$.string_literal,
|
|
1071
|
+
$.boolean_literal,
|
|
1072
|
+
),
|
|
1049
1073
|
// The variant name is an `identifier`, not `constant_name`: because
|
|
1050
1074
|
// `word` unifies all word-shaped lexemes to `identifier`, a `constant_name`
|
|
1051
1075
|
// here can never out-lex `identifier` after `is`/`=>`, which previously
|
package/package.json
CHANGED
package/queries/highlights.scm
CHANGED
package/src/grammar.json
CHANGED
|
@@ -2395,6 +2395,22 @@
|
|
|
2395
2395
|
"type": "STRING",
|
|
2396
2396
|
"value": "{"
|
|
2397
2397
|
},
|
|
2398
|
+
{
|
|
2399
|
+
"type": "CHOICE",
|
|
2400
|
+
"members": [
|
|
2401
|
+
{
|
|
2402
|
+
"type": "FIELD",
|
|
2403
|
+
"name": "cors",
|
|
2404
|
+
"content": {
|
|
2405
|
+
"type": "SYMBOL",
|
|
2406
|
+
"name": "cors_policy"
|
|
2407
|
+
}
|
|
2408
|
+
},
|
|
2409
|
+
{
|
|
2410
|
+
"type": "BLANK"
|
|
2411
|
+
}
|
|
2412
|
+
]
|
|
2413
|
+
},
|
|
2398
2414
|
{
|
|
2399
2415
|
"type": "REPEAT",
|
|
2400
2416
|
"content": {
|
|
@@ -2408,6 +2424,72 @@
|
|
|
2408
2424
|
}
|
|
2409
2425
|
]
|
|
2410
2426
|
},
|
|
2427
|
+
"cors_policy": {
|
|
2428
|
+
"type": "SEQ",
|
|
2429
|
+
"members": [
|
|
2430
|
+
{
|
|
2431
|
+
"type": "STRING",
|
|
2432
|
+
"value": "cors"
|
|
2433
|
+
},
|
|
2434
|
+
{
|
|
2435
|
+
"type": "STRING",
|
|
2436
|
+
"value": "{"
|
|
2437
|
+
},
|
|
2438
|
+
{
|
|
2439
|
+
"type": "REPEAT",
|
|
2440
|
+
"content": {
|
|
2441
|
+
"type": "SEQ",
|
|
2442
|
+
"members": [
|
|
2443
|
+
{
|
|
2444
|
+
"type": "SYMBOL",
|
|
2445
|
+
"name": "cors_field"
|
|
2446
|
+
},
|
|
2447
|
+
{
|
|
2448
|
+
"type": "CHOICE",
|
|
2449
|
+
"members": [
|
|
2450
|
+
{
|
|
2451
|
+
"type": "STRING",
|
|
2452
|
+
"value": ","
|
|
2453
|
+
},
|
|
2454
|
+
{
|
|
2455
|
+
"type": "BLANK"
|
|
2456
|
+
}
|
|
2457
|
+
]
|
|
2458
|
+
}
|
|
2459
|
+
]
|
|
2460
|
+
}
|
|
2461
|
+
},
|
|
2462
|
+
{
|
|
2463
|
+
"type": "STRING",
|
|
2464
|
+
"value": "}"
|
|
2465
|
+
}
|
|
2466
|
+
]
|
|
2467
|
+
},
|
|
2468
|
+
"cors_field": {
|
|
2469
|
+
"type": "SEQ",
|
|
2470
|
+
"members": [
|
|
2471
|
+
{
|
|
2472
|
+
"type": "FIELD",
|
|
2473
|
+
"name": "name",
|
|
2474
|
+
"content": {
|
|
2475
|
+
"type": "SYMBOL",
|
|
2476
|
+
"name": "identifier"
|
|
2477
|
+
}
|
|
2478
|
+
},
|
|
2479
|
+
{
|
|
2480
|
+
"type": "STRING",
|
|
2481
|
+
"value": ":"
|
|
2482
|
+
},
|
|
2483
|
+
{
|
|
2484
|
+
"type": "FIELD",
|
|
2485
|
+
"name": "value",
|
|
2486
|
+
"content": {
|
|
2487
|
+
"type": "SYMBOL",
|
|
2488
|
+
"name": "_expression"
|
|
2489
|
+
}
|
|
2490
|
+
}
|
|
2491
|
+
]
|
|
2492
|
+
},
|
|
2411
2493
|
"service_protocol": {
|
|
2412
2494
|
"type": "SEQ",
|
|
2413
2495
|
"members": [
|
|
@@ -5121,6 +5203,10 @@
|
|
|
5121
5203
|
"type": "SYMBOL",
|
|
5122
5204
|
"name": "wildcard_pattern"
|
|
5123
5205
|
},
|
|
5206
|
+
{
|
|
5207
|
+
"type": "SYMBOL",
|
|
5208
|
+
"name": "literal_pattern"
|
|
5209
|
+
},
|
|
5124
5210
|
{
|
|
5125
5211
|
"type": "SYMBOL",
|
|
5126
5212
|
"name": "variant_pattern"
|
|
@@ -5131,6 +5217,40 @@
|
|
|
5131
5217
|
"type": "STRING",
|
|
5132
5218
|
"value": "_"
|
|
5133
5219
|
},
|
|
5220
|
+
"literal_pattern": {
|
|
5221
|
+
"type": "CHOICE",
|
|
5222
|
+
"members": [
|
|
5223
|
+
{
|
|
5224
|
+
"type": "SEQ",
|
|
5225
|
+
"members": [
|
|
5226
|
+
{
|
|
5227
|
+
"type": "CHOICE",
|
|
5228
|
+
"members": [
|
|
5229
|
+
{
|
|
5230
|
+
"type": "STRING",
|
|
5231
|
+
"value": "-"
|
|
5232
|
+
},
|
|
5233
|
+
{
|
|
5234
|
+
"type": "BLANK"
|
|
5235
|
+
}
|
|
5236
|
+
]
|
|
5237
|
+
},
|
|
5238
|
+
{
|
|
5239
|
+
"type": "SYMBOL",
|
|
5240
|
+
"name": "number_literal"
|
|
5241
|
+
}
|
|
5242
|
+
]
|
|
5243
|
+
},
|
|
5244
|
+
{
|
|
5245
|
+
"type": "SYMBOL",
|
|
5246
|
+
"name": "string_literal"
|
|
5247
|
+
},
|
|
5248
|
+
{
|
|
5249
|
+
"type": "SYMBOL",
|
|
5250
|
+
"name": "boolean_literal"
|
|
5251
|
+
}
|
|
5252
|
+
]
|
|
5253
|
+
},
|
|
5134
5254
|
"variant_pattern": {
|
|
5135
5255
|
"type": "PREC_RIGHT",
|
|
5136
5256
|
"value": 0,
|
package/src/node-types.json
CHANGED
|
@@ -1542,6 +1542,163 @@
|
|
|
1542
1542
|
]
|
|
1543
1543
|
}
|
|
1544
1544
|
},
|
|
1545
|
+
{
|
|
1546
|
+
"type": "cors_field",
|
|
1547
|
+
"named": true,
|
|
1548
|
+
"fields": {
|
|
1549
|
+
"name": {
|
|
1550
|
+
"multiple": false,
|
|
1551
|
+
"required": true,
|
|
1552
|
+
"types": [
|
|
1553
|
+
{
|
|
1554
|
+
"type": "identifier",
|
|
1555
|
+
"named": true
|
|
1556
|
+
}
|
|
1557
|
+
]
|
|
1558
|
+
},
|
|
1559
|
+
"value": {
|
|
1560
|
+
"multiple": false,
|
|
1561
|
+
"required": true,
|
|
1562
|
+
"types": [
|
|
1563
|
+
{
|
|
1564
|
+
"type": "binary_expr",
|
|
1565
|
+
"named": true
|
|
1566
|
+
},
|
|
1567
|
+
{
|
|
1568
|
+
"type": "block",
|
|
1569
|
+
"named": true
|
|
1570
|
+
},
|
|
1571
|
+
{
|
|
1572
|
+
"type": "boolean_literal",
|
|
1573
|
+
"named": true
|
|
1574
|
+
},
|
|
1575
|
+
{
|
|
1576
|
+
"type": "call",
|
|
1577
|
+
"named": true
|
|
1578
|
+
},
|
|
1579
|
+
{
|
|
1580
|
+
"type": "effect_pure_expr",
|
|
1581
|
+
"named": true
|
|
1582
|
+
},
|
|
1583
|
+
{
|
|
1584
|
+
"type": "err_expr",
|
|
1585
|
+
"named": true
|
|
1586
|
+
},
|
|
1587
|
+
{
|
|
1588
|
+
"type": "expect_expr",
|
|
1589
|
+
"named": true
|
|
1590
|
+
},
|
|
1591
|
+
{
|
|
1592
|
+
"type": "field_access",
|
|
1593
|
+
"named": true
|
|
1594
|
+
},
|
|
1595
|
+
{
|
|
1596
|
+
"type": "float_literal",
|
|
1597
|
+
"named": true
|
|
1598
|
+
},
|
|
1599
|
+
{
|
|
1600
|
+
"type": "identifier",
|
|
1601
|
+
"named": true
|
|
1602
|
+
},
|
|
1603
|
+
{
|
|
1604
|
+
"type": "if_expr",
|
|
1605
|
+
"named": true
|
|
1606
|
+
},
|
|
1607
|
+
{
|
|
1608
|
+
"type": "is_expr",
|
|
1609
|
+
"named": true
|
|
1610
|
+
},
|
|
1611
|
+
{
|
|
1612
|
+
"type": "lambda_expr",
|
|
1613
|
+
"named": true
|
|
1614
|
+
},
|
|
1615
|
+
{
|
|
1616
|
+
"type": "list_literal",
|
|
1617
|
+
"named": true
|
|
1618
|
+
},
|
|
1619
|
+
{
|
|
1620
|
+
"type": "match_expr",
|
|
1621
|
+
"named": true
|
|
1622
|
+
},
|
|
1623
|
+
{
|
|
1624
|
+
"type": "method_call",
|
|
1625
|
+
"named": true
|
|
1626
|
+
},
|
|
1627
|
+
{
|
|
1628
|
+
"type": "none_expr",
|
|
1629
|
+
"named": true
|
|
1630
|
+
},
|
|
1631
|
+
{
|
|
1632
|
+
"type": "number_literal",
|
|
1633
|
+
"named": true
|
|
1634
|
+
},
|
|
1635
|
+
{
|
|
1636
|
+
"type": "ok_expr",
|
|
1637
|
+
"named": true
|
|
1638
|
+
},
|
|
1639
|
+
{
|
|
1640
|
+
"type": "paren_expr",
|
|
1641
|
+
"named": true
|
|
1642
|
+
},
|
|
1643
|
+
{
|
|
1644
|
+
"type": "question_expr",
|
|
1645
|
+
"named": true
|
|
1646
|
+
},
|
|
1647
|
+
{
|
|
1648
|
+
"type": "record_construction",
|
|
1649
|
+
"named": true
|
|
1650
|
+
},
|
|
1651
|
+
{
|
|
1652
|
+
"type": "record_spread",
|
|
1653
|
+
"named": true
|
|
1654
|
+
},
|
|
1655
|
+
{
|
|
1656
|
+
"type": "self_expr",
|
|
1657
|
+
"named": true
|
|
1658
|
+
},
|
|
1659
|
+
{
|
|
1660
|
+
"type": "some_expr",
|
|
1661
|
+
"named": true
|
|
1662
|
+
},
|
|
1663
|
+
{
|
|
1664
|
+
"type": "string_literal",
|
|
1665
|
+
"named": true
|
|
1666
|
+
},
|
|
1667
|
+
{
|
|
1668
|
+
"type": "trace_expr",
|
|
1669
|
+
"named": true
|
|
1670
|
+
},
|
|
1671
|
+
{
|
|
1672
|
+
"type": "unary_expr",
|
|
1673
|
+
"named": true
|
|
1674
|
+
},
|
|
1675
|
+
{
|
|
1676
|
+
"type": "unit_literal",
|
|
1677
|
+
"named": true
|
|
1678
|
+
},
|
|
1679
|
+
{
|
|
1680
|
+
"type": "val_expr",
|
|
1681
|
+
"named": true
|
|
1682
|
+
}
|
|
1683
|
+
]
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
},
|
|
1687
|
+
{
|
|
1688
|
+
"type": "cors_policy",
|
|
1689
|
+
"named": true,
|
|
1690
|
+
"fields": {},
|
|
1691
|
+
"children": {
|
|
1692
|
+
"multiple": true,
|
|
1693
|
+
"required": false,
|
|
1694
|
+
"types": [
|
|
1695
|
+
{
|
|
1696
|
+
"type": "cors_field",
|
|
1697
|
+
"named": true
|
|
1698
|
+
}
|
|
1699
|
+
]
|
|
1700
|
+
}
|
|
1701
|
+
},
|
|
1545
1702
|
{
|
|
1546
1703
|
"type": "cron_handler",
|
|
1547
1704
|
"named": true,
|
|
@@ -3668,6 +3825,10 @@
|
|
|
3668
3825
|
"multiple": false,
|
|
3669
3826
|
"required": true,
|
|
3670
3827
|
"types": [
|
|
3828
|
+
{
|
|
3829
|
+
"type": "literal_pattern",
|
|
3830
|
+
"named": true
|
|
3831
|
+
},
|
|
3671
3832
|
{
|
|
3672
3833
|
"type": "variant_pattern",
|
|
3673
3834
|
"named": true
|
|
@@ -4348,6 +4509,29 @@
|
|
|
4348
4509
|
}
|
|
4349
4510
|
}
|
|
4350
4511
|
},
|
|
4512
|
+
{
|
|
4513
|
+
"type": "literal_pattern",
|
|
4514
|
+
"named": true,
|
|
4515
|
+
"fields": {},
|
|
4516
|
+
"children": {
|
|
4517
|
+
"multiple": false,
|
|
4518
|
+
"required": true,
|
|
4519
|
+
"types": [
|
|
4520
|
+
{
|
|
4521
|
+
"type": "boolean_literal",
|
|
4522
|
+
"named": true
|
|
4523
|
+
},
|
|
4524
|
+
{
|
|
4525
|
+
"type": "number_literal",
|
|
4526
|
+
"named": true
|
|
4527
|
+
},
|
|
4528
|
+
{
|
|
4529
|
+
"type": "string_literal",
|
|
4530
|
+
"named": true
|
|
4531
|
+
}
|
|
4532
|
+
]
|
|
4533
|
+
}
|
|
4534
|
+
},
|
|
4351
4535
|
{
|
|
4352
4536
|
"type": "match_arm",
|
|
4353
4537
|
"named": true,
|
|
@@ -4482,6 +4666,10 @@
|
|
|
4482
4666
|
"multiple": false,
|
|
4483
4667
|
"required": true,
|
|
4484
4668
|
"types": [
|
|
4669
|
+
{
|
|
4670
|
+
"type": "literal_pattern",
|
|
4671
|
+
"named": true
|
|
4672
|
+
},
|
|
4485
4673
|
{
|
|
4486
4674
|
"type": "variant_pattern",
|
|
4487
4675
|
"named": true
|
|
@@ -6954,6 +7142,16 @@
|
|
|
6954
7142
|
"type": "service_decl",
|
|
6955
7143
|
"named": true,
|
|
6956
7144
|
"fields": {
|
|
7145
|
+
"cors": {
|
|
7146
|
+
"multiple": false,
|
|
7147
|
+
"required": false,
|
|
7148
|
+
"types": [
|
|
7149
|
+
{
|
|
7150
|
+
"type": "cors_policy",
|
|
7151
|
+
"named": true
|
|
7152
|
+
}
|
|
7153
|
+
]
|
|
7154
|
+
},
|
|
6957
7155
|
"name": {
|
|
6958
7156
|
"multiple": false,
|
|
6959
7157
|
"required": true,
|
|
@@ -9015,6 +9213,10 @@
|
|
|
9015
9213
|
"type": "context",
|
|
9016
9214
|
"named": false
|
|
9017
9215
|
},
|
|
9216
|
+
{
|
|
9217
|
+
"type": "cors",
|
|
9218
|
+
"named": false
|
|
9219
|
+
},
|
|
9018
9220
|
{
|
|
9019
9221
|
"type": "cron",
|
|
9020
9222
|
"named": false
|