tree-sitter-bynk 0.504.3 → 0.508.4
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 +16 -2
- package/package.json +1 -1
- package/queries/highlights.scm +2 -0
- package/src/grammar.json +51 -12
- package/src/node-types.json +34 -4
- package/src/parser.c +74680 -74628
package/grammar.js
CHANGED
|
@@ -288,9 +288,12 @@ module.exports = grammar({
|
|
|
288
288
|
// v0.6: `consumes a.b as Alias`.
|
|
289
289
|
seq("as", field("alias", $.identifier)),
|
|
290
290
|
// v0.17: `consumes a.b { Cap, … }` — selected capabilities.
|
|
291
|
+
// #2887: an exported type may be renamed, `T as Alias`.
|
|
291
292
|
seq(
|
|
292
293
|
"{",
|
|
293
|
-
optional(
|
|
294
|
+
optional(
|
|
295
|
+
sep1($.consumes_item, ","),
|
|
296
|
+
),
|
|
294
297
|
optional(","),
|
|
295
298
|
"}",
|
|
296
299
|
),
|
|
@@ -298,6 +301,14 @@ module.exports = grammar({
|
|
|
298
301
|
),
|
|
299
302
|
),
|
|
300
303
|
|
|
304
|
+
// #2890: one braced item of a selective `consumes`: a name, optionally
|
|
305
|
+
// renamed with `as`.
|
|
306
|
+
consumes_item: ($) =>
|
|
307
|
+
seq(
|
|
308
|
+
field("name", $.identifier),
|
|
309
|
+
optional(seq("as", field("alias", $.identifier))),
|
|
310
|
+
),
|
|
311
|
+
|
|
301
312
|
// v0.17: an adapter's binding module + optional npm dependency map.
|
|
302
313
|
binding_decl: ($) =>
|
|
303
314
|
seq(
|
|
@@ -2004,7 +2015,10 @@ module.exports = grammar({
|
|
|
2004
2015
|
lambda_param: ($) =>
|
|
2005
2016
|
choice(
|
|
2006
2017
|
seq(
|
|
2007
|
-
field(
|
|
2018
|
+
field(
|
|
2019
|
+
"name",
|
|
2020
|
+
choice($.identifier, $._contextual_identifier, alias("_", $.wildcard)),
|
|
2021
|
+
),
|
|
2008
2022
|
optional(seq(":", field("type", $._type_ref))),
|
|
2009
2023
|
),
|
|
2010
2024
|
field("pattern", alias($._lambda_record_pattern, $.record_pattern)),
|
package/package.json
CHANGED
package/queries/highlights.scm
CHANGED
|
@@ -251,6 +251,8 @@
|
|
|
251
251
|
(qualified_name (identifier) @module)
|
|
252
252
|
(uses_decl target: (qualified_name) @module)
|
|
253
253
|
(consumes_decl target: (qualified_name) @module)
|
|
254
|
+
; #2890: the name a `consumes U { T as Alias }` item introduces is a type.
|
|
255
|
+
(consumes_item alias: (identifier) @type)
|
|
254
256
|
(suite_decl target: (qualified_name) @module)
|
|
255
257
|
|
|
256
258
|
; -- Operators & punctuation --
|
package/src/grammar.json
CHANGED
|
@@ -669,12 +669,8 @@
|
|
|
669
669
|
"type": "SEQ",
|
|
670
670
|
"members": [
|
|
671
671
|
{
|
|
672
|
-
"type": "
|
|
673
|
-
"name": "
|
|
674
|
-
"content": {
|
|
675
|
-
"type": "SYMBOL",
|
|
676
|
-
"name": "identifier"
|
|
677
|
-
}
|
|
672
|
+
"type": "SYMBOL",
|
|
673
|
+
"name": "consumes_item"
|
|
678
674
|
},
|
|
679
675
|
{
|
|
680
676
|
"type": "REPEAT",
|
|
@@ -686,12 +682,8 @@
|
|
|
686
682
|
"value": ","
|
|
687
683
|
},
|
|
688
684
|
{
|
|
689
|
-
"type": "
|
|
690
|
-
"name": "
|
|
691
|
-
"content": {
|
|
692
|
-
"type": "SYMBOL",
|
|
693
|
-
"name": "identifier"
|
|
694
|
-
}
|
|
685
|
+
"type": "SYMBOL",
|
|
686
|
+
"name": "consumes_item"
|
|
695
687
|
}
|
|
696
688
|
]
|
|
697
689
|
}
|
|
@@ -730,6 +722,44 @@
|
|
|
730
722
|
}
|
|
731
723
|
]
|
|
732
724
|
},
|
|
725
|
+
"consumes_item": {
|
|
726
|
+
"type": "SEQ",
|
|
727
|
+
"members": [
|
|
728
|
+
{
|
|
729
|
+
"type": "FIELD",
|
|
730
|
+
"name": "name",
|
|
731
|
+
"content": {
|
|
732
|
+
"type": "SYMBOL",
|
|
733
|
+
"name": "identifier"
|
|
734
|
+
}
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
"type": "CHOICE",
|
|
738
|
+
"members": [
|
|
739
|
+
{
|
|
740
|
+
"type": "SEQ",
|
|
741
|
+
"members": [
|
|
742
|
+
{
|
|
743
|
+
"type": "STRING",
|
|
744
|
+
"value": "as"
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
"type": "FIELD",
|
|
748
|
+
"name": "alias",
|
|
749
|
+
"content": {
|
|
750
|
+
"type": "SYMBOL",
|
|
751
|
+
"name": "identifier"
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
]
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
"type": "BLANK"
|
|
758
|
+
}
|
|
759
|
+
]
|
|
760
|
+
}
|
|
761
|
+
]
|
|
762
|
+
},
|
|
733
763
|
"binding_decl": {
|
|
734
764
|
"type": "SEQ",
|
|
735
765
|
"members": [
|
|
@@ -9334,6 +9364,15 @@
|
|
|
9334
9364
|
{
|
|
9335
9365
|
"type": "SYMBOL",
|
|
9336
9366
|
"name": "_contextual_identifier"
|
|
9367
|
+
},
|
|
9368
|
+
{
|
|
9369
|
+
"type": "ALIAS",
|
|
9370
|
+
"content": {
|
|
9371
|
+
"type": "STRING",
|
|
9372
|
+
"value": "_"
|
|
9373
|
+
},
|
|
9374
|
+
"named": true,
|
|
9375
|
+
"value": "wildcard"
|
|
9337
9376
|
}
|
|
9338
9377
|
]
|
|
9339
9378
|
}
|
package/src/node-types.json
CHANGED
|
@@ -2529,8 +2529,34 @@
|
|
|
2529
2529
|
}
|
|
2530
2530
|
]
|
|
2531
2531
|
},
|
|
2532
|
-
"
|
|
2533
|
-
"multiple":
|
|
2532
|
+
"target": {
|
|
2533
|
+
"multiple": false,
|
|
2534
|
+
"required": true,
|
|
2535
|
+
"types": [
|
|
2536
|
+
{
|
|
2537
|
+
"type": "qualified_name",
|
|
2538
|
+
"named": true
|
|
2539
|
+
}
|
|
2540
|
+
]
|
|
2541
|
+
}
|
|
2542
|
+
},
|
|
2543
|
+
"children": {
|
|
2544
|
+
"multiple": true,
|
|
2545
|
+
"required": false,
|
|
2546
|
+
"types": [
|
|
2547
|
+
{
|
|
2548
|
+
"type": "consumes_item",
|
|
2549
|
+
"named": true
|
|
2550
|
+
}
|
|
2551
|
+
]
|
|
2552
|
+
}
|
|
2553
|
+
},
|
|
2554
|
+
{
|
|
2555
|
+
"type": "consumes_item",
|
|
2556
|
+
"named": true,
|
|
2557
|
+
"fields": {
|
|
2558
|
+
"alias": {
|
|
2559
|
+
"multiple": false,
|
|
2534
2560
|
"required": false,
|
|
2535
2561
|
"types": [
|
|
2536
2562
|
{
|
|
@@ -2539,12 +2565,12 @@
|
|
|
2539
2565
|
}
|
|
2540
2566
|
]
|
|
2541
2567
|
},
|
|
2542
|
-
"
|
|
2568
|
+
"name": {
|
|
2543
2569
|
"multiple": false,
|
|
2544
2570
|
"required": true,
|
|
2545
2571
|
"types": [
|
|
2546
2572
|
{
|
|
2547
|
-
"type": "
|
|
2573
|
+
"type": "identifier",
|
|
2548
2574
|
"named": true
|
|
2549
2575
|
}
|
|
2550
2576
|
]
|
|
@@ -6389,6 +6415,10 @@
|
|
|
6389
6415
|
{
|
|
6390
6416
|
"type": "identifier",
|
|
6391
6417
|
"named": true
|
|
6418
|
+
},
|
|
6419
|
+
{
|
|
6420
|
+
"type": "wildcard",
|
|
6421
|
+
"named": true
|
|
6392
6422
|
}
|
|
6393
6423
|
]
|
|
6394
6424
|
},
|