tree-sitter-bynk 0.525.22 → 0.603.10

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
@@ -102,6 +102,15 @@ module.exports = grammar({
102
102
  // Both parses are equivalent once the next `on`/`store`/handler-body
103
103
  // token is seen, so GLR resolves it rather than the grammar needing to.
104
104
  [$.store_field],
105
+ // #3191: `by` is contextual. After a statement's value, `by` opens a
106
+ // call-site actor clause (`let r <- f() by User("bob")`) or is the first
107
+ // token of the next statement, an ordinary name (`by`, `by.log()`). One
108
+ // token cannot tell them apart; GLR keeps both, and `call_site_actor`'s
109
+ // dynamic precedence settles it for the clause. The compiler is the
110
+ // authority on the contrived one-line layout (it also asks for the actor to
111
+ // follow on the same line); the grammar has no newline awareness.
112
+ [$.let_else_stmt],
113
+ [$.effect_let_stmt],
105
114
  ],
106
115
 
107
116
  rules: {
@@ -442,6 +451,8 @@ module.exports = grammar({
442
451
 
443
452
  record_field: ($) =>
444
453
  seq(
454
+ // #3343: `@name("…")` before the field, the key it has on a request.
455
+ repeat(field("annotation", $.store_annotation)),
445
456
  field("name", $.identifier),
446
457
  ":",
447
458
  field("type", $._type_ref),
@@ -807,6 +818,9 @@ module.exports = grammar({
807
818
  ")",
808
819
  "->",
809
820
  field("return_type", $._type_ref),
821
+ // #3458: internal `@name(arg)` annotations (a first-party typed read's
822
+ // failure policy); the checker refuses them outside the std library.
823
+ repeat(field("annotation", $.store_annotation)),
810
824
  ),
811
825
 
812
826
  // message-bundles track, slice 1 (#859): `messages "<tag>" @reference {
@@ -958,6 +972,9 @@ module.exports = grammar({
958
972
  "http",
959
973
  "cron",
960
974
  seq("queue", "(", field("name", $.string_literal), ")"),
975
+ // #3328: `from email("support@shop.example")` — inbound email.
976
+ // `email` is contextual, like `websocket`.
977
+ seq("email", "(", field("address", $.string_literal), ")"),
961
978
  seq(
962
979
  "websocket",
963
980
  "(",
@@ -1140,7 +1157,9 @@ module.exports = grammar({
1140
1157
  ),
1141
1158
  annotation_arg: ($) =>
1142
1159
  seq(
1143
- optional(seq(field("label", $.identifier), ":")),
1160
+ // #3191: `by:` is a label here (`@indexed(by: f)`), and `by` is also a
1161
+ // contextual identifier a value may start with.
1162
+ optional(seq(field("label", choice($.identifier, $._contextual_identifier)), ":")),
1144
1163
  field("value", $._expression),
1145
1164
  ),
1146
1165
 
@@ -1345,7 +1364,8 @@ module.exports = grammar({
1345
1364
  // The closed, compiler-known scheme set. `None`/`Internal` are zero-crypto;
1346
1365
  // `Bearer` (JWT/HS256), `Signature` (HMAC over the body), and `Oidc`
1347
1366
  // (JWKS/RS256+ES256) are compiler-generated verifiers.
1348
- scheme: () => choice("None", "Internal", "Bearer", "Signature", "Oidc", "Foreign"),
1367
+ scheme: () =>
1368
+ choice("None", "Internal", "Bearer", "Signature", "Oidc", "Foreign", "SignedCookie"),
1349
1369
  // v0.51: the keyed-args scheme config — `(key = value, …)`. Values are
1350
1370
  // string or integer literals; the checker validates which keys each scheme
1351
1371
  // admits (Bearer: secret; Signature: secret/header/timestamp/tolerance).
@@ -1355,11 +1375,23 @@ module.exports = grammar({
1355
1375
  sep1($.scheme_arg, ","),
1356
1376
  ")",
1357
1377
  ),
1378
+ // #3386: `12.hours` in a scheme config.
1379
+ scheme_duration: ($) => seq($.number_literal, ".", $.identifier),
1358
1380
  scheme_arg: ($) =>
1359
1381
  seq(
1360
1382
  field("key", $.identifier),
1361
1383
  "=",
1362
- field("value", choice($.string_literal, $.number_literal)),
1384
+ field(
1385
+ "value",
1386
+ choice(
1387
+ $.string_literal,
1388
+ $.number_literal,
1389
+ // #3386: a duration (`ttl = 12.hours`) or a bare variant name
1390
+ // (`sameSite = Lax`).
1391
+ $.scheme_duration,
1392
+ $.identifier,
1393
+ ),
1394
+ ),
1363
1395
  ),
1364
1396
  // v0.45: the handler `by <binder>: <Actor>` clause — sits after the protocol
1365
1397
  // config and before the parameters.
@@ -1592,7 +1624,9 @@ module.exports = grammar({
1592
1624
  // `prec.right` so an immediately-following `(` is taken as the identity
1593
1625
  // argument rather than starting a fresh token sequence.
1594
1626
  call_site_actor: ($) =>
1595
- prec.right(
1627
+ prec.dynamic(
1628
+ 1,
1629
+ prec.right(
1596
1630
  seq(
1597
1631
  "by",
1598
1632
  field("actor", $.identifier),
@@ -1606,6 +1640,7 @@ module.exports = grammar({
1606
1640
  ),
1607
1641
  ),
1608
1642
  ),
1643
+ ),
1609
1644
  ),
1610
1645
  // v0.79: `~> expr` — an asynchronous fire-and-forget send (no binder).
1611
1646
  effect_send_stmt: ($) => seq("~>", field("value", $._expression)),
@@ -2003,8 +2038,9 @@ module.exports = grammar({
2003
2038
  $._contextual_identifier,
2004
2039
  ),
2005
2040
 
2006
- // `trace`, `advance` and `par` are contextual in the compiler — ordinary
2007
- // identifiers outside `trace(Cap.op)` / `advance Clock by …`. Here, as
2041
+ // `trace`, `advance`, `par` and `by` are contextual in the compiler — ordinary
2042
+ // identifiers outside `trace(Cap.op)` / `advance Clock by …` / an actor
2043
+ // clause (`by` is a clause word only before the actor it names, #3191). Here, as
2008
2044
  // `word`-shaped literals, they are extracted as keyword tokens, and where an
2009
2045
  // identifier and the keyword are both valid (an expression or statement
2010
2046
  // head) the keyword always wins the lex. Re-admit the keyword token as an
@@ -2012,7 +2048,7 @@ module.exports = grammar({
2012
2048
  // followed by an identifier can only open an `advance_stmt`, and `trace (`
2013
2049
  // is a declared conflict that `trace_expr`'s dynamic precedence settles.
2014
2050
  _contextual_identifier: ($) =>
2015
- alias(choice("trace", "advance", "par"), $.identifier),
2051
+ alias(choice("trace", "advance", "par", "by"), $.identifier),
2016
2052
 
2017
2053
  // v0.20a: a lambda — `(params) => expr | block`. Conflicts with
2018
2054
  // paren_expr/unit_literal until the `=>` disambiguates (GLR conflict
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tree-sitter-bynk",
3
- "version": "0.525.22",
3
+ "version": "0.603.10",
4
4
  "description": "Tree-sitter grammar for the Bynk language.",
5
5
  "main": "bindings/node",
6
6
  "types": "bindings/node",
@@ -21,6 +21,7 @@
21
21
  "cron"
22
22
  "queue"
23
23
  "websocket"
24
+ "email"
24
25
  "schedule"
25
26
  "message"
26
27
  "Events"
package/src/grammar.json CHANGED
@@ -1534,6 +1534,17 @@
1534
1534
  "record_field": {
1535
1535
  "type": "SEQ",
1536
1536
  "members": [
1537
+ {
1538
+ "type": "REPEAT",
1539
+ "content": {
1540
+ "type": "FIELD",
1541
+ "name": "annotation",
1542
+ "content": {
1543
+ "type": "SYMBOL",
1544
+ "name": "store_annotation"
1545
+ }
1546
+ }
1547
+ },
1537
1548
  {
1538
1549
  "type": "FIELD",
1539
1550
  "name": "name",
@@ -3309,6 +3320,17 @@
3309
3320
  "type": "SYMBOL",
3310
3321
  "name": "_type_ref"
3311
3322
  }
3323
+ },
3324
+ {
3325
+ "type": "REPEAT",
3326
+ "content": {
3327
+ "type": "FIELD",
3328
+ "name": "annotation",
3329
+ "content": {
3330
+ "type": "SYMBOL",
3331
+ "name": "store_annotation"
3332
+ }
3333
+ }
3312
3334
  }
3313
3335
  ]
3314
3336
  },
@@ -4038,6 +4060,31 @@
4038
4060
  }
4039
4061
  ]
4040
4062
  },
4063
+ {
4064
+ "type": "SEQ",
4065
+ "members": [
4066
+ {
4067
+ "type": "STRING",
4068
+ "value": "email"
4069
+ },
4070
+ {
4071
+ "type": "STRING",
4072
+ "value": "("
4073
+ },
4074
+ {
4075
+ "type": "FIELD",
4076
+ "name": "address",
4077
+ "content": {
4078
+ "type": "SYMBOL",
4079
+ "name": "string_literal"
4080
+ }
4081
+ },
4082
+ {
4083
+ "type": "STRING",
4084
+ "value": ")"
4085
+ }
4086
+ ]
4087
+ },
4041
4088
  {
4042
4089
  "type": "SEQ",
4043
4090
  "members": [
@@ -4900,8 +4947,17 @@
4900
4947
  "type": "FIELD",
4901
4948
  "name": "label",
4902
4949
  "content": {
4903
- "type": "SYMBOL",
4904
- "name": "identifier"
4950
+ "type": "CHOICE",
4951
+ "members": [
4952
+ {
4953
+ "type": "SYMBOL",
4954
+ "name": "identifier"
4955
+ },
4956
+ {
4957
+ "type": "SYMBOL",
4958
+ "name": "_contextual_identifier"
4959
+ }
4960
+ ]
4905
4961
  }
4906
4962
  },
4907
4963
  {
@@ -6180,6 +6236,10 @@
6180
6236
  {
6181
6237
  "type": "STRING",
6182
6238
  "value": "Foreign"
6239
+ },
6240
+ {
6241
+ "type": "STRING",
6242
+ "value": "SignedCookie"
6183
6243
  }
6184
6244
  ]
6185
6245
  },
@@ -6221,6 +6281,23 @@
6221
6281
  }
6222
6282
  ]
6223
6283
  },
6284
+ "scheme_duration": {
6285
+ "type": "SEQ",
6286
+ "members": [
6287
+ {
6288
+ "type": "SYMBOL",
6289
+ "name": "number_literal"
6290
+ },
6291
+ {
6292
+ "type": "STRING",
6293
+ "value": "."
6294
+ },
6295
+ {
6296
+ "type": "SYMBOL",
6297
+ "name": "identifier"
6298
+ }
6299
+ ]
6300
+ },
6224
6301
  "scheme_arg": {
6225
6302
  "type": "SEQ",
6226
6303
  "members": [
@@ -6249,6 +6326,14 @@
6249
6326
  {
6250
6327
  "type": "SYMBOL",
6251
6328
  "name": "number_literal"
6329
+ },
6330
+ {
6331
+ "type": "SYMBOL",
6332
+ "name": "scheme_duration"
6333
+ },
6334
+ {
6335
+ "type": "SYMBOL",
6336
+ "name": "identifier"
6252
6337
  }
6253
6338
  ]
6254
6339
  }
@@ -7566,78 +7651,82 @@
7566
7651
  ]
7567
7652
  },
7568
7653
  "call_site_actor": {
7569
- "type": "PREC_RIGHT",
7570
- "value": 0,
7654
+ "type": "PREC_DYNAMIC",
7655
+ "value": 1,
7571
7656
  "content": {
7572
- "type": "SEQ",
7573
- "members": [
7574
- {
7575
- "type": "STRING",
7576
- "value": "by"
7577
- },
7578
- {
7579
- "type": "FIELD",
7580
- "name": "actor",
7581
- "content": {
7582
- "type": "SYMBOL",
7583
- "name": "identifier"
7584
- }
7585
- },
7586
- {
7587
- "type": "CHOICE",
7588
- "members": [
7589
- {
7590
- "type": "SEQ",
7591
- "members": [
7592
- {
7593
- "type": "STRING",
7594
- "value": "("
7595
- },
7596
- {
7597
- "type": "FIELD",
7598
- "name": "identity",
7599
- "content": {
7600
- "type": "SYMBOL",
7601
- "name": "_expression"
7602
- }
7603
- },
7604
- {
7605
- "type": "CHOICE",
7606
- "members": [
7607
- {
7608
- "type": "SEQ",
7609
- "members": [
7610
- {
7611
- "type": "STRING",
7612
- "value": ","
7613
- },
7614
- {
7615
- "type": "FIELD",
7616
- "name": "claims",
7617
- "content": {
7618
- "type": "SYMBOL",
7619
- "name": "_expression"
7620
- }
7621
- }
7622
- ]
7623
- },
7624
- {
7625
- "type": "BLANK"
7626
- }
7627
- ]
7628
- },
7629
- {
7630
- "type": "STRING",
7631
- "value": ")"
7632
- }
7633
- ]
7634
- },
7635
- {
7636
- "type": "BLANK"
7657
+ "type": "PREC_RIGHT",
7658
+ "value": 0,
7659
+ "content": {
7660
+ "type": "SEQ",
7661
+ "members": [
7662
+ {
7663
+ "type": "STRING",
7664
+ "value": "by"
7665
+ },
7666
+ {
7667
+ "type": "FIELD",
7668
+ "name": "actor",
7669
+ "content": {
7670
+ "type": "SYMBOL",
7671
+ "name": "identifier"
7637
7672
  }
7638
- ]
7639
- }
7640
- ]
7673
+ },
7674
+ {
7675
+ "type": "CHOICE",
7676
+ "members": [
7677
+ {
7678
+ "type": "SEQ",
7679
+ "members": [
7680
+ {
7681
+ "type": "STRING",
7682
+ "value": "("
7683
+ },
7684
+ {
7685
+ "type": "FIELD",
7686
+ "name": "identity",
7687
+ "content": {
7688
+ "type": "SYMBOL",
7689
+ "name": "_expression"
7690
+ }
7691
+ },
7692
+ {
7693
+ "type": "CHOICE",
7694
+ "members": [
7695
+ {
7696
+ "type": "SEQ",
7697
+ "members": [
7698
+ {
7699
+ "type": "STRING",
7700
+ "value": ","
7701
+ },
7702
+ {
7703
+ "type": "FIELD",
7704
+ "name": "claims",
7705
+ "content": {
7706
+ "type": "SYMBOL",
7707
+ "name": "_expression"
7708
+ }
7709
+ }
7710
+ ]
7711
+ },
7712
+ {
7713
+ "type": "BLANK"
7714
+ }
7715
+ ]
7716
+ },
7717
+ {
7718
+ "type": "STRING",
7719
+ "value": ")"
7720
+ }
7721
+ ]
7722
+ },
7723
+ {
7724
+ "type": "BLANK"
7725
+ }
7726
+ ]
7727
+ }
7728
+ ]
7729
+ }
7641
7730
  }
7642
7731
  },
7643
7732
  "effect_send_stmt": {
@@ -9313,6 +9402,10 @@
9313
9402
  {
9314
9403
  "type": "STRING",
9315
9404
  "value": "par"
9405
+ },
9406
+ {
9407
+ "type": "STRING",
9408
+ "value": "by"
9316
9409
  }
9317
9410
  ]
9318
9411
  },
@@ -10938,6 +11031,12 @@
10938
11031
  ],
10939
11032
  [
10940
11033
  "store_field"
11034
+ ],
11035
+ [
11036
+ "let_else_stmt"
11037
+ ],
11038
+ [
11039
+ "effect_let_stmt"
10941
11040
  ]
10942
11041
  ],
10943
11042
  "precedences": [],
@@ -1948,6 +1948,16 @@
1948
1948
  "type": "capability_op",
1949
1949
  "named": true,
1950
1950
  "fields": {
1951
+ "annotation": {
1952
+ "multiple": true,
1953
+ "required": false,
1954
+ "types": [
1955
+ {
1956
+ "type": "store_annotation",
1957
+ "named": true
1958
+ }
1959
+ ]
1960
+ },
1951
1961
  "name": {
1952
1962
  "multiple": false,
1953
1963
  "required": true,
@@ -10295,10 +10305,18 @@
10295
10305
  "multiple": false,
10296
10306
  "required": true,
10297
10307
  "types": [
10308
+ {
10309
+ "type": "identifier",
10310
+ "named": true
10311
+ },
10298
10312
  {
10299
10313
  "type": "number_literal",
10300
10314
  "named": true
10301
10315
  },
10316
+ {
10317
+ "type": "scheme_duration",
10318
+ "named": true
10319
+ },
10302
10320
  {
10303
10321
  "type": "string_literal",
10304
10322
  "named": true
@@ -10322,6 +10340,25 @@
10322
10340
  ]
10323
10341
  }
10324
10342
  },
10343
+ {
10344
+ "type": "scheme_duration",
10345
+ "named": true,
10346
+ "fields": {},
10347
+ "children": {
10348
+ "multiple": true,
10349
+ "required": true,
10350
+ "types": [
10351
+ {
10352
+ "type": "identifier",
10353
+ "named": true
10354
+ },
10355
+ {
10356
+ "type": "number_literal",
10357
+ "named": true
10358
+ }
10359
+ ]
10360
+ }
10361
+ },
10325
10362
  {
10326
10363
  "type": "security_field",
10327
10364
  "named": true,
@@ -10607,6 +10644,16 @@
10607
10644
  "type": "service_protocol",
10608
10645
  "named": true,
10609
10646
  "fields": {
10647
+ "address": {
10648
+ "multiple": false,
10649
+ "required": false,
10650
+ "types": [
10651
+ {
10652
+ "type": "string_literal",
10653
+ "named": true
10654
+ }
10655
+ ]
10656
+ },
10610
10657
  "event_type": {
10611
10658
  "multiple": false,
10612
10659
  "required": false,
@@ -13822,6 +13869,10 @@
13822
13869
  "type": "Signature",
13823
13870
  "named": false
13824
13871
  },
13872
+ {
13873
+ "type": "SignedCookie",
13874
+ "named": false
13875
+ },
13825
13876
  {
13826
13877
  "type": "Some",
13827
13878
  "named": false
@@ -13992,6 +14043,10 @@
13992
14043
  "type": "else",
13993
14044
  "named": false
13994
14045
  },
14046
+ {
14047
+ "type": "email",
14048
+ "named": false
14049
+ },
13995
14050
  {
13996
14051
  "type": "embed",
13997
14052
  "named": false