tree-sitter-bynk 0.525.22 → 0.562.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 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),
@@ -958,6 +969,9 @@ module.exports = grammar({
958
969
  "http",
959
970
  "cron",
960
971
  seq("queue", "(", field("name", $.string_literal), ")"),
972
+ // #3328: `from email("support@shop.example")` — inbound email.
973
+ // `email` is contextual, like `websocket`.
974
+ seq("email", "(", field("address", $.string_literal), ")"),
961
975
  seq(
962
976
  "websocket",
963
977
  "(",
@@ -1140,7 +1154,9 @@ module.exports = grammar({
1140
1154
  ),
1141
1155
  annotation_arg: ($) =>
1142
1156
  seq(
1143
- optional(seq(field("label", $.identifier), ":")),
1157
+ // #3191: `by:` is a label here (`@indexed(by: f)`), and `by` is also a
1158
+ // contextual identifier a value may start with.
1159
+ optional(seq(field("label", choice($.identifier, $._contextual_identifier)), ":")),
1144
1160
  field("value", $._expression),
1145
1161
  ),
1146
1162
 
@@ -1592,7 +1608,9 @@ module.exports = grammar({
1592
1608
  // `prec.right` so an immediately-following `(` is taken as the identity
1593
1609
  // argument rather than starting a fresh token sequence.
1594
1610
  call_site_actor: ($) =>
1595
- prec.right(
1611
+ prec.dynamic(
1612
+ 1,
1613
+ prec.right(
1596
1614
  seq(
1597
1615
  "by",
1598
1616
  field("actor", $.identifier),
@@ -1606,6 +1624,7 @@ module.exports = grammar({
1606
1624
  ),
1607
1625
  ),
1608
1626
  ),
1627
+ ),
1609
1628
  ),
1610
1629
  // v0.79: `~> expr` — an asynchronous fire-and-forget send (no binder).
1611
1630
  effect_send_stmt: ($) => seq("~>", field("value", $._expression)),
@@ -2003,8 +2022,9 @@ module.exports = grammar({
2003
2022
  $._contextual_identifier,
2004
2023
  ),
2005
2024
 
2006
- // `trace`, `advance` and `par` are contextual in the compiler — ordinary
2007
- // identifiers outside `trace(Cap.op)` / `advance Clock by …`. Here, as
2025
+ // `trace`, `advance`, `par` and `by` are contextual in the compiler — ordinary
2026
+ // identifiers outside `trace(Cap.op)` / `advance Clock by …` / an actor
2027
+ // clause (`by` is a clause word only before the actor it names, #3191). Here, as
2008
2028
  // `word`-shaped literals, they are extracted as keyword tokens, and where an
2009
2029
  // identifier and the keyword are both valid (an expression or statement
2010
2030
  // head) the keyword always wins the lex. Re-admit the keyword token as an
@@ -2012,7 +2032,7 @@ module.exports = grammar({
2012
2032
  // followed by an identifier can only open an `advance_stmt`, and `trace (`
2013
2033
  // is a declared conflict that `trace_expr`'s dynamic precedence settles.
2014
2034
  _contextual_identifier: ($) =>
2015
- alias(choice("trace", "advance", "par"), $.identifier),
2035
+ alias(choice("trace", "advance", "par", "by"), $.identifier),
2016
2036
 
2017
2037
  // v0.20a: a lambda — `(params) => expr | block`. Conflicts with
2018
2038
  // 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.562.0",
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",
@@ -4038,6 +4049,31 @@
4038
4049
  }
4039
4050
  ]
4040
4051
  },
4052
+ {
4053
+ "type": "SEQ",
4054
+ "members": [
4055
+ {
4056
+ "type": "STRING",
4057
+ "value": "email"
4058
+ },
4059
+ {
4060
+ "type": "STRING",
4061
+ "value": "("
4062
+ },
4063
+ {
4064
+ "type": "FIELD",
4065
+ "name": "address",
4066
+ "content": {
4067
+ "type": "SYMBOL",
4068
+ "name": "string_literal"
4069
+ }
4070
+ },
4071
+ {
4072
+ "type": "STRING",
4073
+ "value": ")"
4074
+ }
4075
+ ]
4076
+ },
4041
4077
  {
4042
4078
  "type": "SEQ",
4043
4079
  "members": [
@@ -4900,8 +4936,17 @@
4900
4936
  "type": "FIELD",
4901
4937
  "name": "label",
4902
4938
  "content": {
4903
- "type": "SYMBOL",
4904
- "name": "identifier"
4939
+ "type": "CHOICE",
4940
+ "members": [
4941
+ {
4942
+ "type": "SYMBOL",
4943
+ "name": "identifier"
4944
+ },
4945
+ {
4946
+ "type": "SYMBOL",
4947
+ "name": "_contextual_identifier"
4948
+ }
4949
+ ]
4905
4950
  }
4906
4951
  },
4907
4952
  {
@@ -7566,78 +7611,82 @@
7566
7611
  ]
7567
7612
  },
7568
7613
  "call_site_actor": {
7569
- "type": "PREC_RIGHT",
7570
- "value": 0,
7614
+ "type": "PREC_DYNAMIC",
7615
+ "value": 1,
7571
7616
  "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"
7617
+ "type": "PREC_RIGHT",
7618
+ "value": 0,
7619
+ "content": {
7620
+ "type": "SEQ",
7621
+ "members": [
7622
+ {
7623
+ "type": "STRING",
7624
+ "value": "by"
7625
+ },
7626
+ {
7627
+ "type": "FIELD",
7628
+ "name": "actor",
7629
+ "content": {
7630
+ "type": "SYMBOL",
7631
+ "name": "identifier"
7637
7632
  }
7638
- ]
7639
- }
7640
- ]
7633
+ },
7634
+ {
7635
+ "type": "CHOICE",
7636
+ "members": [
7637
+ {
7638
+ "type": "SEQ",
7639
+ "members": [
7640
+ {
7641
+ "type": "STRING",
7642
+ "value": "("
7643
+ },
7644
+ {
7645
+ "type": "FIELD",
7646
+ "name": "identity",
7647
+ "content": {
7648
+ "type": "SYMBOL",
7649
+ "name": "_expression"
7650
+ }
7651
+ },
7652
+ {
7653
+ "type": "CHOICE",
7654
+ "members": [
7655
+ {
7656
+ "type": "SEQ",
7657
+ "members": [
7658
+ {
7659
+ "type": "STRING",
7660
+ "value": ","
7661
+ },
7662
+ {
7663
+ "type": "FIELD",
7664
+ "name": "claims",
7665
+ "content": {
7666
+ "type": "SYMBOL",
7667
+ "name": "_expression"
7668
+ }
7669
+ }
7670
+ ]
7671
+ },
7672
+ {
7673
+ "type": "BLANK"
7674
+ }
7675
+ ]
7676
+ },
7677
+ {
7678
+ "type": "STRING",
7679
+ "value": ")"
7680
+ }
7681
+ ]
7682
+ },
7683
+ {
7684
+ "type": "BLANK"
7685
+ }
7686
+ ]
7687
+ }
7688
+ ]
7689
+ }
7641
7690
  }
7642
7691
  },
7643
7692
  "effect_send_stmt": {
@@ -9313,6 +9362,10 @@
9313
9362
  {
9314
9363
  "type": "STRING",
9315
9364
  "value": "par"
9365
+ },
9366
+ {
9367
+ "type": "STRING",
9368
+ "value": "by"
9316
9369
  }
9317
9370
  ]
9318
9371
  },
@@ -10938,6 +10991,12 @@
10938
10991
  ],
10939
10992
  [
10940
10993
  "store_field"
10994
+ ],
10995
+ [
10996
+ "let_else_stmt"
10997
+ ],
10998
+ [
10999
+ "effect_let_stmt"
10941
11000
  ]
10942
11001
  ],
10943
11002
  "precedences": [],
@@ -10607,6 +10607,16 @@
10607
10607
  "type": "service_protocol",
10608
10608
  "named": true,
10609
10609
  "fields": {
10610
+ "address": {
10611
+ "multiple": false,
10612
+ "required": false,
10613
+ "types": [
10614
+ {
10615
+ "type": "string_literal",
10616
+ "named": true
10617
+ }
10618
+ ]
10619
+ },
10610
10620
  "event_type": {
10611
10621
  "multiple": false,
10612
10622
  "required": false,
@@ -13992,6 +14002,10 @@
13992
14002
  "type": "else",
13993
14003
  "named": false
13994
14004
  },
14005
+ {
14006
+ "type": "email",
14007
+ "named": false
14008
+ },
13995
14009
  {
13996
14010
  "type": "embed",
13997
14011
  "named": false