tree-sitter-bynk 0.223.1 → 0.229.2
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 +30 -0
- package/package.json +1 -1
- package/queries/highlights.scm +1 -0
- package/src/grammar.json +92 -0
- package/src/node-types.json +82 -0
- package/src/parser.c +45214 -44307
package/grammar.js
CHANGED
|
@@ -182,6 +182,7 @@ module.exports = grammar({
|
|
|
182
182
|
$.uses_decl,
|
|
183
183
|
$.type_decl,
|
|
184
184
|
$.fn_decl,
|
|
185
|
+
$.messages_decl,
|
|
185
186
|
// Permissive: capability/service/etc. can syntactically appear
|
|
186
187
|
// anywhere — the LSP reports semantic placement errors.
|
|
187
188
|
$.capability_decl,
|
|
@@ -203,6 +204,7 @@ module.exports = grammar({
|
|
|
203
204
|
$.service_decl,
|
|
204
205
|
$.agent_decl,
|
|
205
206
|
$.actor_decl,
|
|
207
|
+
$.messages_decl,
|
|
206
208
|
),
|
|
207
209
|
|
|
208
210
|
// v0.17: adapter items — a binding clause, capabilities, boundary types,
|
|
@@ -223,6 +225,7 @@ module.exports = grammar({
|
|
|
223
225
|
$.service_decl,
|
|
224
226
|
$.agent_decl,
|
|
225
227
|
$.actor_decl,
|
|
228
|
+
$.messages_decl,
|
|
226
229
|
),
|
|
227
230
|
|
|
228
231
|
_test_body_item: ($) =>
|
|
@@ -578,6 +581,33 @@ module.exports = grammar({
|
|
|
578
581
|
field("return_type", $._type_ref),
|
|
579
582
|
),
|
|
580
583
|
|
|
584
|
+
// message-bundles track, slice 1 (#859): `messages <tag> @reference {
|
|
585
|
+
// "code" => "template" ... }` — a commons item declaring one locale's
|
|
586
|
+
// message bundle. `tag` is a plain identifier (its `LocaleTag`
|
|
587
|
+
// refinement is a checker concern); annotations reuse `store_annotation`
|
|
588
|
+
// (the same general `@name(args)` shape, ADR 0111) — the parser stays
|
|
589
|
+
// permissive on cardinality, same as the Rust side. Legality
|
|
590
|
+
// (commons-only) is a checker concern too, so this rule is admitted in
|
|
591
|
+
// `_context_body_item`/`_adapter_body_item` as well, mirroring
|
|
592
|
+
// `service_decl`/`agent_decl`'s existing permissive placement there.
|
|
593
|
+
messages_decl: ($) =>
|
|
594
|
+
seq(
|
|
595
|
+
"messages",
|
|
596
|
+
field("tag", $.identifier),
|
|
597
|
+
repeat(field("annotation", $.store_annotation)),
|
|
598
|
+
"{",
|
|
599
|
+
repeat($.message_entry),
|
|
600
|
+
"}",
|
|
601
|
+
),
|
|
602
|
+
// A trailing comma is permitted but not required (mirrors match_arm).
|
|
603
|
+
message_entry: ($) =>
|
|
604
|
+
seq(
|
|
605
|
+
field("code", $.string_literal),
|
|
606
|
+
"=>",
|
|
607
|
+
field("template", $.string_literal),
|
|
608
|
+
optional(","),
|
|
609
|
+
),
|
|
610
|
+
|
|
581
611
|
provider_decl: ($) =>
|
|
582
612
|
seq(
|
|
583
613
|
"provides",
|
package/package.json
CHANGED
package/queries/highlights.scm
CHANGED
package/src/grammar.json
CHANGED
|
@@ -383,6 +383,10 @@
|
|
|
383
383
|
"type": "SYMBOL",
|
|
384
384
|
"name": "fn_decl"
|
|
385
385
|
},
|
|
386
|
+
{
|
|
387
|
+
"type": "SYMBOL",
|
|
388
|
+
"name": "messages_decl"
|
|
389
|
+
},
|
|
386
390
|
{
|
|
387
391
|
"type": "SYMBOL",
|
|
388
392
|
"name": "capability_decl"
|
|
@@ -447,6 +451,10 @@
|
|
|
447
451
|
{
|
|
448
452
|
"type": "SYMBOL",
|
|
449
453
|
"name": "actor_decl"
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
"type": "SYMBOL",
|
|
457
|
+
"name": "messages_decl"
|
|
450
458
|
}
|
|
451
459
|
]
|
|
452
460
|
},
|
|
@@ -496,6 +504,10 @@
|
|
|
496
504
|
{
|
|
497
505
|
"type": "SYMBOL",
|
|
498
506
|
"name": "actor_decl"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"type": "SYMBOL",
|
|
510
|
+
"name": "messages_decl"
|
|
499
511
|
}
|
|
500
512
|
]
|
|
501
513
|
},
|
|
@@ -2428,6 +2440,86 @@
|
|
|
2428
2440
|
}
|
|
2429
2441
|
]
|
|
2430
2442
|
},
|
|
2443
|
+
"messages_decl": {
|
|
2444
|
+
"type": "SEQ",
|
|
2445
|
+
"members": [
|
|
2446
|
+
{
|
|
2447
|
+
"type": "STRING",
|
|
2448
|
+
"value": "messages"
|
|
2449
|
+
},
|
|
2450
|
+
{
|
|
2451
|
+
"type": "FIELD",
|
|
2452
|
+
"name": "tag",
|
|
2453
|
+
"content": {
|
|
2454
|
+
"type": "SYMBOL",
|
|
2455
|
+
"name": "identifier"
|
|
2456
|
+
}
|
|
2457
|
+
},
|
|
2458
|
+
{
|
|
2459
|
+
"type": "REPEAT",
|
|
2460
|
+
"content": {
|
|
2461
|
+
"type": "FIELD",
|
|
2462
|
+
"name": "annotation",
|
|
2463
|
+
"content": {
|
|
2464
|
+
"type": "SYMBOL",
|
|
2465
|
+
"name": "store_annotation"
|
|
2466
|
+
}
|
|
2467
|
+
}
|
|
2468
|
+
},
|
|
2469
|
+
{
|
|
2470
|
+
"type": "STRING",
|
|
2471
|
+
"value": "{"
|
|
2472
|
+
},
|
|
2473
|
+
{
|
|
2474
|
+
"type": "REPEAT",
|
|
2475
|
+
"content": {
|
|
2476
|
+
"type": "SYMBOL",
|
|
2477
|
+
"name": "message_entry"
|
|
2478
|
+
}
|
|
2479
|
+
},
|
|
2480
|
+
{
|
|
2481
|
+
"type": "STRING",
|
|
2482
|
+
"value": "}"
|
|
2483
|
+
}
|
|
2484
|
+
]
|
|
2485
|
+
},
|
|
2486
|
+
"message_entry": {
|
|
2487
|
+
"type": "SEQ",
|
|
2488
|
+
"members": [
|
|
2489
|
+
{
|
|
2490
|
+
"type": "FIELD",
|
|
2491
|
+
"name": "code",
|
|
2492
|
+
"content": {
|
|
2493
|
+
"type": "SYMBOL",
|
|
2494
|
+
"name": "string_literal"
|
|
2495
|
+
}
|
|
2496
|
+
},
|
|
2497
|
+
{
|
|
2498
|
+
"type": "STRING",
|
|
2499
|
+
"value": "=>"
|
|
2500
|
+
},
|
|
2501
|
+
{
|
|
2502
|
+
"type": "FIELD",
|
|
2503
|
+
"name": "template",
|
|
2504
|
+
"content": {
|
|
2505
|
+
"type": "SYMBOL",
|
|
2506
|
+
"name": "string_literal"
|
|
2507
|
+
}
|
|
2508
|
+
},
|
|
2509
|
+
{
|
|
2510
|
+
"type": "CHOICE",
|
|
2511
|
+
"members": [
|
|
2512
|
+
{
|
|
2513
|
+
"type": "STRING",
|
|
2514
|
+
"value": ","
|
|
2515
|
+
},
|
|
2516
|
+
{
|
|
2517
|
+
"type": "BLANK"
|
|
2518
|
+
}
|
|
2519
|
+
]
|
|
2520
|
+
}
|
|
2521
|
+
]
|
|
2522
|
+
},
|
|
2431
2523
|
"provider_decl": {
|
|
2432
2524
|
"type": "SEQ",
|
|
2433
2525
|
"members": [
|
package/src/node-types.json
CHANGED
|
@@ -256,6 +256,10 @@
|
|
|
256
256
|
"type": "fn_decl",
|
|
257
257
|
"named": true
|
|
258
258
|
},
|
|
259
|
+
{
|
|
260
|
+
"type": "messages_decl",
|
|
261
|
+
"named": true
|
|
262
|
+
},
|
|
259
263
|
{
|
|
260
264
|
"type": "provider_decl",
|
|
261
265
|
"named": true
|
|
@@ -1789,6 +1793,10 @@
|
|
|
1789
1793
|
"type": "fn_decl",
|
|
1790
1794
|
"named": true
|
|
1791
1795
|
},
|
|
1796
|
+
{
|
|
1797
|
+
"type": "messages_decl",
|
|
1798
|
+
"named": true
|
|
1799
|
+
},
|
|
1792
1800
|
{
|
|
1793
1801
|
"type": "provider_decl",
|
|
1794
1802
|
"named": true
|
|
@@ -1887,6 +1895,10 @@
|
|
|
1887
1895
|
"type": "fn_decl",
|
|
1888
1896
|
"named": true
|
|
1889
1897
|
},
|
|
1898
|
+
{
|
|
1899
|
+
"type": "messages_decl",
|
|
1900
|
+
"named": true
|
|
1901
|
+
},
|
|
1890
1902
|
{
|
|
1891
1903
|
"type": "provider_decl",
|
|
1892
1904
|
"named": true
|
|
@@ -5761,6 +5773,68 @@
|
|
|
5761
5773
|
]
|
|
5762
5774
|
}
|
|
5763
5775
|
},
|
|
5776
|
+
{
|
|
5777
|
+
"type": "message_entry",
|
|
5778
|
+
"named": true,
|
|
5779
|
+
"fields": {
|
|
5780
|
+
"code": {
|
|
5781
|
+
"multiple": false,
|
|
5782
|
+
"required": true,
|
|
5783
|
+
"types": [
|
|
5784
|
+
{
|
|
5785
|
+
"type": "string_literal",
|
|
5786
|
+
"named": true
|
|
5787
|
+
}
|
|
5788
|
+
]
|
|
5789
|
+
},
|
|
5790
|
+
"template": {
|
|
5791
|
+
"multiple": false,
|
|
5792
|
+
"required": true,
|
|
5793
|
+
"types": [
|
|
5794
|
+
{
|
|
5795
|
+
"type": "string_literal",
|
|
5796
|
+
"named": true
|
|
5797
|
+
}
|
|
5798
|
+
]
|
|
5799
|
+
}
|
|
5800
|
+
}
|
|
5801
|
+
},
|
|
5802
|
+
{
|
|
5803
|
+
"type": "messages_decl",
|
|
5804
|
+
"named": true,
|
|
5805
|
+
"fields": {
|
|
5806
|
+
"annotation": {
|
|
5807
|
+
"multiple": true,
|
|
5808
|
+
"required": false,
|
|
5809
|
+
"types": [
|
|
5810
|
+
{
|
|
5811
|
+
"type": "store_annotation",
|
|
5812
|
+
"named": true
|
|
5813
|
+
}
|
|
5814
|
+
]
|
|
5815
|
+
},
|
|
5816
|
+
"tag": {
|
|
5817
|
+
"multiple": false,
|
|
5818
|
+
"required": true,
|
|
5819
|
+
"types": [
|
|
5820
|
+
{
|
|
5821
|
+
"type": "identifier",
|
|
5822
|
+
"named": true
|
|
5823
|
+
}
|
|
5824
|
+
]
|
|
5825
|
+
}
|
|
5826
|
+
},
|
|
5827
|
+
"children": {
|
|
5828
|
+
"multiple": true,
|
|
5829
|
+
"required": false,
|
|
5830
|
+
"types": [
|
|
5831
|
+
{
|
|
5832
|
+
"type": "message_entry",
|
|
5833
|
+
"named": true
|
|
5834
|
+
}
|
|
5835
|
+
]
|
|
5836
|
+
}
|
|
5837
|
+
},
|
|
5764
5838
|
{
|
|
5765
5839
|
"type": "method_call",
|
|
5766
5840
|
"named": true,
|
|
@@ -8494,6 +8568,10 @@
|
|
|
8494
8568
|
"type": "let_stmt",
|
|
8495
8569
|
"named": true
|
|
8496
8570
|
},
|
|
8571
|
+
{
|
|
8572
|
+
"type": "messages_decl",
|
|
8573
|
+
"named": true
|
|
8574
|
+
},
|
|
8497
8575
|
{
|
|
8498
8576
|
"type": "provider_decl",
|
|
8499
8577
|
"named": true
|
|
@@ -10925,6 +11003,10 @@
|
|
|
10925
11003
|
"type": "message",
|
|
10926
11004
|
"named": false
|
|
10927
11005
|
},
|
|
11006
|
+
{
|
|
11007
|
+
"type": "messages",
|
|
11008
|
+
"named": false
|
|
11009
|
+
},
|
|
10928
11010
|
{
|
|
10929
11011
|
"type": "never",
|
|
10930
11012
|
"named": false
|