@hew-lang/tree-sitter-hew 1.3.1 → 1.4.1
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 +3 -2
- package/package.json +1 -1
- package/queries/highlights.scm +2 -0
- package/src/grammar.json +87 -7
- package/src/parser.c +102211 -95748
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -864,7 +864,7 @@ export default grammar({
|
|
|
864
864
|
function_type: $ => prec(1, seq(
|
|
865
865
|
'fn', optional($.callable_capabilities),
|
|
866
866
|
optional($.type_parameters),
|
|
867
|
-
'(', optional(sep1($._type, ',')), ')', optional($.return_type),
|
|
867
|
+
'(', optional(sep1(choice($._type, seq('consume', $._type), alias('consume', $.identifier)), ',')), ')', optional($.return_type),
|
|
868
868
|
)),
|
|
869
869
|
|
|
870
870
|
// actor(M) [-> R] — the type of an anonymous actor handle
|
|
@@ -1425,7 +1425,8 @@ export default grammar({
|
|
|
1425
1425
|
)),
|
|
1426
1426
|
|
|
1427
1427
|
lambda_parameter: $ => seq(
|
|
1428
|
-
|
|
1428
|
+
optional('consume'),
|
|
1429
|
+
field('name', choice($.identifier, alias('consume', $.identifier))),
|
|
1429
1430
|
optional(seq(':', field('type', $._type))),
|
|
1430
1431
|
),
|
|
1431
1432
|
|
package/package.json
CHANGED
package/queries/highlights.scm
CHANGED
package/src/grammar.json
CHANGED
|
@@ -5238,8 +5238,35 @@
|
|
|
5238
5238
|
"type": "SEQ",
|
|
5239
5239
|
"members": [
|
|
5240
5240
|
{
|
|
5241
|
-
"type": "
|
|
5242
|
-
"
|
|
5241
|
+
"type": "CHOICE",
|
|
5242
|
+
"members": [
|
|
5243
|
+
{
|
|
5244
|
+
"type": "SYMBOL",
|
|
5245
|
+
"name": "_type"
|
|
5246
|
+
},
|
|
5247
|
+
{
|
|
5248
|
+
"type": "SEQ",
|
|
5249
|
+
"members": [
|
|
5250
|
+
{
|
|
5251
|
+
"type": "STRING",
|
|
5252
|
+
"value": "consume"
|
|
5253
|
+
},
|
|
5254
|
+
{
|
|
5255
|
+
"type": "SYMBOL",
|
|
5256
|
+
"name": "_type"
|
|
5257
|
+
}
|
|
5258
|
+
]
|
|
5259
|
+
},
|
|
5260
|
+
{
|
|
5261
|
+
"type": "ALIAS",
|
|
5262
|
+
"content": {
|
|
5263
|
+
"type": "STRING",
|
|
5264
|
+
"value": "consume"
|
|
5265
|
+
},
|
|
5266
|
+
"named": true,
|
|
5267
|
+
"value": "identifier"
|
|
5268
|
+
}
|
|
5269
|
+
]
|
|
5243
5270
|
},
|
|
5244
5271
|
{
|
|
5245
5272
|
"type": "REPEAT",
|
|
@@ -5251,8 +5278,35 @@
|
|
|
5251
5278
|
"value": ","
|
|
5252
5279
|
},
|
|
5253
5280
|
{
|
|
5254
|
-
"type": "
|
|
5255
|
-
"
|
|
5281
|
+
"type": "CHOICE",
|
|
5282
|
+
"members": [
|
|
5283
|
+
{
|
|
5284
|
+
"type": "SYMBOL",
|
|
5285
|
+
"name": "_type"
|
|
5286
|
+
},
|
|
5287
|
+
{
|
|
5288
|
+
"type": "SEQ",
|
|
5289
|
+
"members": [
|
|
5290
|
+
{
|
|
5291
|
+
"type": "STRING",
|
|
5292
|
+
"value": "consume"
|
|
5293
|
+
},
|
|
5294
|
+
{
|
|
5295
|
+
"type": "SYMBOL",
|
|
5296
|
+
"name": "_type"
|
|
5297
|
+
}
|
|
5298
|
+
]
|
|
5299
|
+
},
|
|
5300
|
+
{
|
|
5301
|
+
"type": "ALIAS",
|
|
5302
|
+
"content": {
|
|
5303
|
+
"type": "STRING",
|
|
5304
|
+
"value": "consume"
|
|
5305
|
+
},
|
|
5306
|
+
"named": true,
|
|
5307
|
+
"value": "identifier"
|
|
5308
|
+
}
|
|
5309
|
+
]
|
|
5256
5310
|
}
|
|
5257
5311
|
]
|
|
5258
5312
|
}
|
|
@@ -9012,12 +9066,38 @@
|
|
|
9012
9066
|
"lambda_parameter": {
|
|
9013
9067
|
"type": "SEQ",
|
|
9014
9068
|
"members": [
|
|
9069
|
+
{
|
|
9070
|
+
"type": "CHOICE",
|
|
9071
|
+
"members": [
|
|
9072
|
+
{
|
|
9073
|
+
"type": "STRING",
|
|
9074
|
+
"value": "consume"
|
|
9075
|
+
},
|
|
9076
|
+
{
|
|
9077
|
+
"type": "BLANK"
|
|
9078
|
+
}
|
|
9079
|
+
]
|
|
9080
|
+
},
|
|
9015
9081
|
{
|
|
9016
9082
|
"type": "FIELD",
|
|
9017
9083
|
"name": "name",
|
|
9018
9084
|
"content": {
|
|
9019
|
-
"type": "
|
|
9020
|
-
"
|
|
9085
|
+
"type": "CHOICE",
|
|
9086
|
+
"members": [
|
|
9087
|
+
{
|
|
9088
|
+
"type": "SYMBOL",
|
|
9089
|
+
"name": "identifier"
|
|
9090
|
+
},
|
|
9091
|
+
{
|
|
9092
|
+
"type": "ALIAS",
|
|
9093
|
+
"content": {
|
|
9094
|
+
"type": "STRING",
|
|
9095
|
+
"value": "consume"
|
|
9096
|
+
},
|
|
9097
|
+
"named": true,
|
|
9098
|
+
"value": "identifier"
|
|
9099
|
+
}
|
|
9100
|
+
]
|
|
9021
9101
|
}
|
|
9022
9102
|
},
|
|
9023
9103
|
{
|
|
@@ -10788,4 +10868,4 @@
|
|
|
10788
10868
|
],
|
|
10789
10869
|
"supertypes": [],
|
|
10790
10870
|
"reserved": {}
|
|
10791
|
-
}
|
|
10871
|
+
}
|