@hew-lang/tree-sitter-hew 1.2.1 → 1.2.3
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 +5 -6
- package/package.json +1 -1
- package/src/grammar.json +28 -21
- package/src/node-types.json +8 -8
- package/src/parser.c +77966 -77433
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -221,8 +221,7 @@ export default grammar({
|
|
|
221
221
|
';',
|
|
222
222
|
),
|
|
223
223
|
|
|
224
|
-
//
|
|
225
|
-
// struct fields, variants, AND fn declarations (TypeBody). The alias form
|
|
224
|
+
// A type body holds fields; methods belong in a sibling impl block. The alias form
|
|
226
225
|
// `type Name = Type;` is handled separately by `type_alias`.
|
|
227
226
|
struct_declaration: $ => seq(
|
|
228
227
|
'type',
|
|
@@ -235,7 +234,6 @@ export default grammar({
|
|
|
235
234
|
struct_body: $ => seq('{', repeat(choice(
|
|
236
235
|
$.struct_field,
|
|
237
236
|
$.reserved_declaration,
|
|
238
|
-
seq(optional($.visibility), $.function_declaration),
|
|
239
237
|
)), '}'),
|
|
240
238
|
|
|
241
239
|
// StructFieldDecl / WireStructFieldDecl (grammar.ebnf:68, 76):
|
|
@@ -801,6 +799,7 @@ export default grammar({
|
|
|
801
799
|
primitive_type: $ => choice(
|
|
802
800
|
'i8', 'i16', 'i32', 'i64', 'u8', 'u16', 'u32', 'u64', 'isize', 'usize',
|
|
803
801
|
'f32', 'f64', 'bool', 'char', 'string', 'bytes', 'duration', 'instant',
|
|
802
|
+
'timestamp',
|
|
804
803
|
),
|
|
805
804
|
|
|
806
805
|
generic_type: $ => prec(1, seq($.identifier, $.type_arguments)),
|
|
@@ -1391,7 +1390,7 @@ export default grammar({
|
|
|
1391
1390
|
)),
|
|
1392
1391
|
|
|
1393
1392
|
private_capture_list: $ => seq(
|
|
1394
|
-
'capture', '(', sep1($.private_capture, ','), ')',
|
|
1393
|
+
'capture', '(', sep1($.private_capture, ','), optional(','), ')',
|
|
1395
1394
|
),
|
|
1396
1395
|
|
|
1397
1396
|
private_capture: $ => seq('var', field('name', $.identifier)),
|
|
@@ -1401,11 +1400,11 @@ export default grammar({
|
|
|
1401
1400
|
optional(seq(':', field('type', $._type))),
|
|
1402
1401
|
),
|
|
1403
1402
|
|
|
1404
|
-
//
|
|
1405
|
-
// Replaces the removed `spawn (...) => ...` lambda-actor form.
|
|
1403
|
+
// Actor literals share the closure prefix for private mutable captures.
|
|
1406
1404
|
actor_expression: $ => prec(2, seq(
|
|
1407
1405
|
'actor',
|
|
1408
1406
|
optional('move'),
|
|
1407
|
+
optional($.private_capture_list),
|
|
1409
1408
|
'|',
|
|
1410
1409
|
optional(sep1($.lambda_parameter, ',')),
|
|
1411
1410
|
'|',
|
package/package.json
CHANGED
package/src/grammar.json
CHANGED
|
@@ -1080,27 +1080,6 @@
|
|
|
1080
1080
|
{
|
|
1081
1081
|
"type": "SYMBOL",
|
|
1082
1082
|
"name": "reserved_declaration"
|
|
1083
|
-
},
|
|
1084
|
-
{
|
|
1085
|
-
"type": "SEQ",
|
|
1086
|
-
"members": [
|
|
1087
|
-
{
|
|
1088
|
-
"type": "CHOICE",
|
|
1089
|
-
"members": [
|
|
1090
|
-
{
|
|
1091
|
-
"type": "SYMBOL",
|
|
1092
|
-
"name": "visibility"
|
|
1093
|
-
},
|
|
1094
|
-
{
|
|
1095
|
-
"type": "BLANK"
|
|
1096
|
-
}
|
|
1097
|
-
]
|
|
1098
|
-
},
|
|
1099
|
-
{
|
|
1100
|
-
"type": "SYMBOL",
|
|
1101
|
-
"name": "function_declaration"
|
|
1102
|
-
}
|
|
1103
|
-
]
|
|
1104
1083
|
}
|
|
1105
1084
|
]
|
|
1106
1085
|
}
|
|
@@ -4715,6 +4694,10 @@
|
|
|
4715
4694
|
{
|
|
4716
4695
|
"type": "STRING",
|
|
4717
4696
|
"value": "instant"
|
|
4697
|
+
},
|
|
4698
|
+
{
|
|
4699
|
+
"type": "STRING",
|
|
4700
|
+
"value": "timestamp"
|
|
4718
4701
|
}
|
|
4719
4702
|
]
|
|
4720
4703
|
},
|
|
@@ -8794,6 +8777,18 @@
|
|
|
8794
8777
|
}
|
|
8795
8778
|
]
|
|
8796
8779
|
},
|
|
8780
|
+
{
|
|
8781
|
+
"type": "CHOICE",
|
|
8782
|
+
"members": [
|
|
8783
|
+
{
|
|
8784
|
+
"type": "STRING",
|
|
8785
|
+
"value": ","
|
|
8786
|
+
},
|
|
8787
|
+
{
|
|
8788
|
+
"type": "BLANK"
|
|
8789
|
+
}
|
|
8790
|
+
]
|
|
8791
|
+
},
|
|
8797
8792
|
{
|
|
8798
8793
|
"type": "STRING",
|
|
8799
8794
|
"value": ")"
|
|
@@ -8877,6 +8872,18 @@
|
|
|
8877
8872
|
}
|
|
8878
8873
|
]
|
|
8879
8874
|
},
|
|
8875
|
+
{
|
|
8876
|
+
"type": "CHOICE",
|
|
8877
|
+
"members": [
|
|
8878
|
+
{
|
|
8879
|
+
"type": "SYMBOL",
|
|
8880
|
+
"name": "private_capture_list"
|
|
8881
|
+
},
|
|
8882
|
+
{
|
|
8883
|
+
"type": "BLANK"
|
|
8884
|
+
}
|
|
8885
|
+
]
|
|
8886
|
+
},
|
|
8880
8887
|
{
|
|
8881
8888
|
"type": "STRING",
|
|
8882
8889
|
"value": "|"
|
package/src/node-types.json
CHANGED
|
@@ -88,6 +88,10 @@
|
|
|
88
88
|
"type": "lambda_parameter",
|
|
89
89
|
"named": true
|
|
90
90
|
},
|
|
91
|
+
{
|
|
92
|
+
"type": "private_capture_list",
|
|
93
|
+
"named": true
|
|
94
|
+
},
|
|
91
95
|
{
|
|
92
96
|
"type": "return_type",
|
|
93
97
|
"named": true
|
|
@@ -5701,10 +5705,6 @@
|
|
|
5701
5705
|
"multiple": true,
|
|
5702
5706
|
"required": false,
|
|
5703
5707
|
"types": [
|
|
5704
|
-
{
|
|
5705
|
-
"type": "function_declaration",
|
|
5706
|
-
"named": true
|
|
5707
|
-
},
|
|
5708
5708
|
{
|
|
5709
5709
|
"type": "reserved_declaration",
|
|
5710
5710
|
"named": true
|
|
@@ -5712,10 +5712,6 @@
|
|
|
5712
5712
|
{
|
|
5713
5713
|
"type": "struct_field",
|
|
5714
5714
|
"named": true
|
|
5715
|
-
},
|
|
5716
|
-
{
|
|
5717
|
-
"type": "visibility",
|
|
5718
|
-
"named": true
|
|
5719
5715
|
}
|
|
5720
5716
|
]
|
|
5721
5717
|
}
|
|
@@ -7766,6 +7762,10 @@
|
|
|
7766
7762
|
"type": "temporary",
|
|
7767
7763
|
"named": false
|
|
7768
7764
|
},
|
|
7765
|
+
{
|
|
7766
|
+
"type": "timestamp",
|
|
7767
|
+
"named": false
|
|
7768
|
+
},
|
|
7769
7769
|
{
|
|
7770
7770
|
"type": "trait",
|
|
7771
7771
|
"named": false
|