tree-sitter-bynk 0.141.0 → 0.142.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 +17 -2
- package/package.json +1 -1
- package/queries/highlights.scm +1 -0
- package/src/grammar.json +84 -2
- package/src/node-types.json +171 -0
- package/src/parser.c +29980 -28789
package/grammar.js
CHANGED
|
@@ -547,6 +547,9 @@ module.exports = grammar({
|
|
|
547
547
|
// v0.141 (ADR 0164): the optional `security { }` policy, likewise a
|
|
548
548
|
// header-position `from http` concern restricted by the checker.
|
|
549
549
|
optional(field("security", $.security_policy)),
|
|
550
|
+
// v0.142 (ADR 0166): the optional `limits { }` policy, likewise a
|
|
551
|
+
// header-position `from http` concern restricted by the checker.
|
|
552
|
+
optional(field("limits", $.limits_policy)),
|
|
550
553
|
repeat($.handler),
|
|
551
554
|
"}",
|
|
552
555
|
),
|
|
@@ -574,6 +577,18 @@ module.exports = grammar({
|
|
|
574
577
|
),
|
|
575
578
|
security_field: ($) =>
|
|
576
579
|
seq(field("name", $.identifier), ":", field("value", $._expression)),
|
|
580
|
+
// v0.142: `limits { <name>: <value>, … }`. `limits` is a contextual
|
|
581
|
+
// keyword (like `cors`/`security`); field names are ordinary identifiers
|
|
582
|
+
// matched against the closed set by the checker.
|
|
583
|
+
limits_policy: ($) =>
|
|
584
|
+
seq(
|
|
585
|
+
"limits",
|
|
586
|
+
"{",
|
|
587
|
+
repeat(seq($.limits_field, optional(","))),
|
|
588
|
+
"}",
|
|
589
|
+
),
|
|
590
|
+
limits_field: ($) =>
|
|
591
|
+
seq(field("name", $.identifier), ":", field("value", $._expression)),
|
|
577
592
|
// v0.44: `from <protocol>` on the service header.
|
|
578
593
|
// v0.103: `from WebSocket(in: I, out: O)` binds the inbound/outbound frame
|
|
579
594
|
// types. `WebSocket`, `in`, and `out` are contextual (resolved by `word`).
|
|
@@ -1312,12 +1327,12 @@ module.exports = grammar({
|
|
|
1312
1327
|
// overshadowing `identifier`; we use a regex.
|
|
1313
1328
|
constant_name: () => /[A-Z][A-Za-z0-9_]*/,
|
|
1314
1329
|
|
|
1315
|
-
number_literal: () => /[0-9]
|
|
1330
|
+
number_literal: () => /[0-9]+(_[0-9]+)*/,
|
|
1316
1331
|
// v0.21: a float literal — fraction with a digit on both sides of the
|
|
1317
1332
|
// `.`, an exponent, or both. Longest-match keeps `1.toFloat()` lexing
|
|
1318
1333
|
// as a method call on an integer literal.
|
|
1319
1334
|
float_literal: () =>
|
|
1320
|
-
/[0-9]
|
|
1335
|
+
/[0-9]+(_[0-9]+)*\.[0-9]+(_[0-9]+)*([eE][+-]?[0-9]+(_[0-9]+)*)?|[0-9]+(_[0-9]+)*[eE][+-]?[0-9]+(_[0-9]+)*/,
|
|
1321
1336
|
string_literal: ($) =>
|
|
1322
1337
|
seq(
|
|
1323
1338
|
'"',
|
package/package.json
CHANGED
package/queries/highlights.scm
CHANGED
package/src/grammar.json
CHANGED
|
@@ -2427,6 +2427,22 @@
|
|
|
2427
2427
|
}
|
|
2428
2428
|
]
|
|
2429
2429
|
},
|
|
2430
|
+
{
|
|
2431
|
+
"type": "CHOICE",
|
|
2432
|
+
"members": [
|
|
2433
|
+
{
|
|
2434
|
+
"type": "FIELD",
|
|
2435
|
+
"name": "limits",
|
|
2436
|
+
"content": {
|
|
2437
|
+
"type": "SYMBOL",
|
|
2438
|
+
"name": "limits_policy"
|
|
2439
|
+
}
|
|
2440
|
+
},
|
|
2441
|
+
{
|
|
2442
|
+
"type": "BLANK"
|
|
2443
|
+
}
|
|
2444
|
+
]
|
|
2445
|
+
},
|
|
2430
2446
|
{
|
|
2431
2447
|
"type": "REPEAT",
|
|
2432
2448
|
"content": {
|
|
@@ -2572,6 +2588,72 @@
|
|
|
2572
2588
|
}
|
|
2573
2589
|
]
|
|
2574
2590
|
},
|
|
2591
|
+
"limits_policy": {
|
|
2592
|
+
"type": "SEQ",
|
|
2593
|
+
"members": [
|
|
2594
|
+
{
|
|
2595
|
+
"type": "STRING",
|
|
2596
|
+
"value": "limits"
|
|
2597
|
+
},
|
|
2598
|
+
{
|
|
2599
|
+
"type": "STRING",
|
|
2600
|
+
"value": "{"
|
|
2601
|
+
},
|
|
2602
|
+
{
|
|
2603
|
+
"type": "REPEAT",
|
|
2604
|
+
"content": {
|
|
2605
|
+
"type": "SEQ",
|
|
2606
|
+
"members": [
|
|
2607
|
+
{
|
|
2608
|
+
"type": "SYMBOL",
|
|
2609
|
+
"name": "limits_field"
|
|
2610
|
+
},
|
|
2611
|
+
{
|
|
2612
|
+
"type": "CHOICE",
|
|
2613
|
+
"members": [
|
|
2614
|
+
{
|
|
2615
|
+
"type": "STRING",
|
|
2616
|
+
"value": ","
|
|
2617
|
+
},
|
|
2618
|
+
{
|
|
2619
|
+
"type": "BLANK"
|
|
2620
|
+
}
|
|
2621
|
+
]
|
|
2622
|
+
}
|
|
2623
|
+
]
|
|
2624
|
+
}
|
|
2625
|
+
},
|
|
2626
|
+
{
|
|
2627
|
+
"type": "STRING",
|
|
2628
|
+
"value": "}"
|
|
2629
|
+
}
|
|
2630
|
+
]
|
|
2631
|
+
},
|
|
2632
|
+
"limits_field": {
|
|
2633
|
+
"type": "SEQ",
|
|
2634
|
+
"members": [
|
|
2635
|
+
{
|
|
2636
|
+
"type": "FIELD",
|
|
2637
|
+
"name": "name",
|
|
2638
|
+
"content": {
|
|
2639
|
+
"type": "SYMBOL",
|
|
2640
|
+
"name": "identifier"
|
|
2641
|
+
}
|
|
2642
|
+
},
|
|
2643
|
+
{
|
|
2644
|
+
"type": "STRING",
|
|
2645
|
+
"value": ":"
|
|
2646
|
+
},
|
|
2647
|
+
{
|
|
2648
|
+
"type": "FIELD",
|
|
2649
|
+
"name": "value",
|
|
2650
|
+
"content": {
|
|
2651
|
+
"type": "SYMBOL",
|
|
2652
|
+
"name": "_expression"
|
|
2653
|
+
}
|
|
2654
|
+
}
|
|
2655
|
+
]
|
|
2656
|
+
},
|
|
2575
2657
|
"service_protocol": {
|
|
2576
2658
|
"type": "SEQ",
|
|
2577
2659
|
"members": [
|
|
@@ -6867,11 +6949,11 @@
|
|
|
6867
6949
|
},
|
|
6868
6950
|
"number_literal": {
|
|
6869
6951
|
"type": "PATTERN",
|
|
6870
|
-
"value": "[0-9]+"
|
|
6952
|
+
"value": "[0-9]+(_[0-9]+)*"
|
|
6871
6953
|
},
|
|
6872
6954
|
"float_literal": {
|
|
6873
6955
|
"type": "PATTERN",
|
|
6874
|
-
"value": "[0-9]
|
|
6956
|
+
"value": "[0-9]+(_[0-9]+)*\\.[0-9]+(_[0-9]+)*([eE][+-]?[0-9]+(_[0-9]+)*)?|[0-9]+(_[0-9]+)*[eE][+-]?[0-9]+(_[0-9]+)*"
|
|
6875
6957
|
},
|
|
6876
6958
|
"string_literal": {
|
|
6877
6959
|
"type": "SEQ",
|
package/src/node-types.json
CHANGED
|
@@ -4377,6 +4377,163 @@
|
|
|
4377
4377
|
}
|
|
4378
4378
|
}
|
|
4379
4379
|
},
|
|
4380
|
+
{
|
|
4381
|
+
"type": "limits_field",
|
|
4382
|
+
"named": true,
|
|
4383
|
+
"fields": {
|
|
4384
|
+
"name": {
|
|
4385
|
+
"multiple": false,
|
|
4386
|
+
"required": true,
|
|
4387
|
+
"types": [
|
|
4388
|
+
{
|
|
4389
|
+
"type": "identifier",
|
|
4390
|
+
"named": true
|
|
4391
|
+
}
|
|
4392
|
+
]
|
|
4393
|
+
},
|
|
4394
|
+
"value": {
|
|
4395
|
+
"multiple": false,
|
|
4396
|
+
"required": true,
|
|
4397
|
+
"types": [
|
|
4398
|
+
{
|
|
4399
|
+
"type": "binary_expr",
|
|
4400
|
+
"named": true
|
|
4401
|
+
},
|
|
4402
|
+
{
|
|
4403
|
+
"type": "block",
|
|
4404
|
+
"named": true
|
|
4405
|
+
},
|
|
4406
|
+
{
|
|
4407
|
+
"type": "boolean_literal",
|
|
4408
|
+
"named": true
|
|
4409
|
+
},
|
|
4410
|
+
{
|
|
4411
|
+
"type": "call",
|
|
4412
|
+
"named": true
|
|
4413
|
+
},
|
|
4414
|
+
{
|
|
4415
|
+
"type": "effect_pure_expr",
|
|
4416
|
+
"named": true
|
|
4417
|
+
},
|
|
4418
|
+
{
|
|
4419
|
+
"type": "err_expr",
|
|
4420
|
+
"named": true
|
|
4421
|
+
},
|
|
4422
|
+
{
|
|
4423
|
+
"type": "expect_expr",
|
|
4424
|
+
"named": true
|
|
4425
|
+
},
|
|
4426
|
+
{
|
|
4427
|
+
"type": "field_access",
|
|
4428
|
+
"named": true
|
|
4429
|
+
},
|
|
4430
|
+
{
|
|
4431
|
+
"type": "float_literal",
|
|
4432
|
+
"named": true
|
|
4433
|
+
},
|
|
4434
|
+
{
|
|
4435
|
+
"type": "identifier",
|
|
4436
|
+
"named": true
|
|
4437
|
+
},
|
|
4438
|
+
{
|
|
4439
|
+
"type": "if_expr",
|
|
4440
|
+
"named": true
|
|
4441
|
+
},
|
|
4442
|
+
{
|
|
4443
|
+
"type": "is_expr",
|
|
4444
|
+
"named": true
|
|
4445
|
+
},
|
|
4446
|
+
{
|
|
4447
|
+
"type": "lambda_expr",
|
|
4448
|
+
"named": true
|
|
4449
|
+
},
|
|
4450
|
+
{
|
|
4451
|
+
"type": "list_literal",
|
|
4452
|
+
"named": true
|
|
4453
|
+
},
|
|
4454
|
+
{
|
|
4455
|
+
"type": "match_expr",
|
|
4456
|
+
"named": true
|
|
4457
|
+
},
|
|
4458
|
+
{
|
|
4459
|
+
"type": "method_call",
|
|
4460
|
+
"named": true
|
|
4461
|
+
},
|
|
4462
|
+
{
|
|
4463
|
+
"type": "none_expr",
|
|
4464
|
+
"named": true
|
|
4465
|
+
},
|
|
4466
|
+
{
|
|
4467
|
+
"type": "number_literal",
|
|
4468
|
+
"named": true
|
|
4469
|
+
},
|
|
4470
|
+
{
|
|
4471
|
+
"type": "ok_expr",
|
|
4472
|
+
"named": true
|
|
4473
|
+
},
|
|
4474
|
+
{
|
|
4475
|
+
"type": "paren_expr",
|
|
4476
|
+
"named": true
|
|
4477
|
+
},
|
|
4478
|
+
{
|
|
4479
|
+
"type": "question_expr",
|
|
4480
|
+
"named": true
|
|
4481
|
+
},
|
|
4482
|
+
{
|
|
4483
|
+
"type": "record_construction",
|
|
4484
|
+
"named": true
|
|
4485
|
+
},
|
|
4486
|
+
{
|
|
4487
|
+
"type": "record_spread",
|
|
4488
|
+
"named": true
|
|
4489
|
+
},
|
|
4490
|
+
{
|
|
4491
|
+
"type": "self_expr",
|
|
4492
|
+
"named": true
|
|
4493
|
+
},
|
|
4494
|
+
{
|
|
4495
|
+
"type": "some_expr",
|
|
4496
|
+
"named": true
|
|
4497
|
+
},
|
|
4498
|
+
{
|
|
4499
|
+
"type": "string_literal",
|
|
4500
|
+
"named": true
|
|
4501
|
+
},
|
|
4502
|
+
{
|
|
4503
|
+
"type": "trace_expr",
|
|
4504
|
+
"named": true
|
|
4505
|
+
},
|
|
4506
|
+
{
|
|
4507
|
+
"type": "unary_expr",
|
|
4508
|
+
"named": true
|
|
4509
|
+
},
|
|
4510
|
+
{
|
|
4511
|
+
"type": "unit_literal",
|
|
4512
|
+
"named": true
|
|
4513
|
+
},
|
|
4514
|
+
{
|
|
4515
|
+
"type": "val_expr",
|
|
4516
|
+
"named": true
|
|
4517
|
+
}
|
|
4518
|
+
]
|
|
4519
|
+
}
|
|
4520
|
+
}
|
|
4521
|
+
},
|
|
4522
|
+
{
|
|
4523
|
+
"type": "limits_policy",
|
|
4524
|
+
"named": true,
|
|
4525
|
+
"fields": {},
|
|
4526
|
+
"children": {
|
|
4527
|
+
"multiple": true,
|
|
4528
|
+
"required": false,
|
|
4529
|
+
"types": [
|
|
4530
|
+
{
|
|
4531
|
+
"type": "limits_field",
|
|
4532
|
+
"named": true
|
|
4533
|
+
}
|
|
4534
|
+
]
|
|
4535
|
+
}
|
|
4536
|
+
},
|
|
4380
4537
|
{
|
|
4381
4538
|
"type": "list_literal",
|
|
4382
4539
|
"named": true,
|
|
@@ -7309,6 +7466,16 @@
|
|
|
7309
7466
|
}
|
|
7310
7467
|
]
|
|
7311
7468
|
},
|
|
7469
|
+
"limits": {
|
|
7470
|
+
"multiple": false,
|
|
7471
|
+
"required": false,
|
|
7472
|
+
"types": [
|
|
7473
|
+
{
|
|
7474
|
+
"type": "limits_policy",
|
|
7475
|
+
"named": true
|
|
7476
|
+
}
|
|
7477
|
+
]
|
|
7478
|
+
},
|
|
7312
7479
|
"name": {
|
|
7313
7480
|
"multiple": false,
|
|
7314
7481
|
"required": true,
|
|
@@ -9489,6 +9656,10 @@
|
|
|
9489
9656
|
"type": "let",
|
|
9490
9657
|
"named": false
|
|
9491
9658
|
},
|
|
9659
|
+
{
|
|
9660
|
+
"type": "limits",
|
|
9661
|
+
"named": false
|
|
9662
|
+
},
|
|
9492
9663
|
{
|
|
9493
9664
|
"type": "line_comment",
|
|
9494
9665
|
"named": true,
|