tree-sitter-java-orchard 0.5.5 → 0.5.7
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 -7
- package/package.json +1 -1
- package/src/grammar.json +117 -11
- package/src/node-types.json +70 -18
- package/src/parser.c +35564 -35127
- package/tree-sitter-java_orchard.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -73,6 +73,7 @@ module.exports = grammar({
|
|
|
73
73
|
],
|
|
74
74
|
|
|
75
75
|
conflicts: $ => [
|
|
76
|
+
[$.modifiers],
|
|
76
77
|
[$.modifiers, $.annotated_type, $.receiver_parameter],
|
|
77
78
|
[$.modifiers, $.annotated_type, $.module_declaration, $.package_declaration],
|
|
78
79
|
[$._unannotated_type, $.primary_expression, $.inferred_parameters],
|
|
@@ -306,10 +307,10 @@ module.exports = grammar({
|
|
|
306
307
|
instanceof_expression: $ => prec(PREC.REL, seq(
|
|
307
308
|
field('left', $.expression),
|
|
308
309
|
'instanceof',
|
|
309
|
-
optional(
|
|
310
|
+
optional($.modifiers),
|
|
310
311
|
choice(
|
|
311
312
|
seq(
|
|
312
|
-
field('right', $.
|
|
313
|
+
field('right', $._unannotated_type),
|
|
313
314
|
optional(field('name', choice($.identifier, $._reserved_identifier))),
|
|
314
315
|
),
|
|
315
316
|
field('pattern', $.record_pattern),
|
|
@@ -517,7 +518,16 @@ module.exports = grammar({
|
|
|
517
518
|
seq('case',
|
|
518
519
|
choice(
|
|
519
520
|
commaSep1($.pattern),
|
|
520
|
-
commaSep1(
|
|
521
|
+
commaSep1(
|
|
522
|
+
choice(
|
|
523
|
+
$.binary_expression,
|
|
524
|
+
$.instanceof_expression,
|
|
525
|
+
$.ternary_expression,
|
|
526
|
+
$.primary_expression,
|
|
527
|
+
$.unary_expression,
|
|
528
|
+
$.cast_expression,
|
|
529
|
+
),
|
|
530
|
+
),
|
|
521
531
|
),
|
|
522
532
|
optional($.guard),
|
|
523
533
|
),
|
|
@@ -528,7 +538,7 @@ module.exports = grammar({
|
|
|
528
538
|
$.type_pattern,
|
|
529
539
|
$.record_pattern,
|
|
530
540
|
),
|
|
531
|
-
type_pattern: $ => seq($._unannotated_type, choice($.identifier, $._reserved_identifier)),
|
|
541
|
+
type_pattern: $ => seq(optional($.modifiers), $._unannotated_type, choice($.identifier, $._reserved_identifier)),
|
|
532
542
|
record_pattern: $ => seq(choice($.identifier, $._reserved_identifier, $.generic_type, $.scoped_type_identifier), $.record_pattern_body),
|
|
533
543
|
record_pattern_body: $ => seq('(', commaSep(choice($.record_pattern_component, $.record_pattern)), ')'),
|
|
534
544
|
record_pattern_component: $ => choice(
|
|
@@ -542,7 +552,20 @@ module.exports = grammar({
|
|
|
542
552
|
|
|
543
553
|
underscore_pattern: _ => '_',
|
|
544
554
|
|
|
545
|
-
guard: $ => seq(
|
|
555
|
+
guard: $ => seq(
|
|
556
|
+
'when',
|
|
557
|
+
choice(
|
|
558
|
+
$.assignment_expression,
|
|
559
|
+
$.binary_expression,
|
|
560
|
+
$.instanceof_expression,
|
|
561
|
+
$.ternary_expression,
|
|
562
|
+
$.update_expression,
|
|
563
|
+
$.primary_expression,
|
|
564
|
+
$.unary_expression,
|
|
565
|
+
$.cast_expression,
|
|
566
|
+
$.switch_expression,
|
|
567
|
+
),
|
|
568
|
+
),
|
|
546
569
|
|
|
547
570
|
// Statements
|
|
548
571
|
|
|
@@ -838,8 +861,8 @@ module.exports = grammar({
|
|
|
838
861
|
'provides',
|
|
839
862
|
field('provided', $._name),
|
|
840
863
|
'with',
|
|
841
|
-
$._name,
|
|
842
|
-
repeat(seq(',',
|
|
864
|
+
field('provider', $._name),
|
|
865
|
+
repeat(seq(',', field('provider', $._name))),
|
|
843
866
|
';',
|
|
844
867
|
),
|
|
845
868
|
|
package/package.json
CHANGED
package/src/grammar.json
CHANGED
|
@@ -2232,8 +2232,8 @@
|
|
|
2232
2232
|
"type": "CHOICE",
|
|
2233
2233
|
"members": [
|
|
2234
2234
|
{
|
|
2235
|
-
"type": "
|
|
2236
|
-
"
|
|
2235
|
+
"type": "SYMBOL",
|
|
2236
|
+
"name": "modifiers"
|
|
2237
2237
|
},
|
|
2238
2238
|
{
|
|
2239
2239
|
"type": "BLANK"
|
|
@@ -2251,7 +2251,7 @@
|
|
|
2251
2251
|
"name": "right",
|
|
2252
2252
|
"content": {
|
|
2253
2253
|
"type": "SYMBOL",
|
|
2254
|
-
"name": "
|
|
2254
|
+
"name": "_unannotated_type"
|
|
2255
2255
|
}
|
|
2256
2256
|
},
|
|
2257
2257
|
{
|
|
@@ -3536,8 +3536,33 @@
|
|
|
3536
3536
|
"type": "SEQ",
|
|
3537
3537
|
"members": [
|
|
3538
3538
|
{
|
|
3539
|
-
"type": "
|
|
3540
|
-
"
|
|
3539
|
+
"type": "CHOICE",
|
|
3540
|
+
"members": [
|
|
3541
|
+
{
|
|
3542
|
+
"type": "SYMBOL",
|
|
3543
|
+
"name": "binary_expression"
|
|
3544
|
+
},
|
|
3545
|
+
{
|
|
3546
|
+
"type": "SYMBOL",
|
|
3547
|
+
"name": "instanceof_expression"
|
|
3548
|
+
},
|
|
3549
|
+
{
|
|
3550
|
+
"type": "SYMBOL",
|
|
3551
|
+
"name": "ternary_expression"
|
|
3552
|
+
},
|
|
3553
|
+
{
|
|
3554
|
+
"type": "SYMBOL",
|
|
3555
|
+
"name": "primary_expression"
|
|
3556
|
+
},
|
|
3557
|
+
{
|
|
3558
|
+
"type": "SYMBOL",
|
|
3559
|
+
"name": "unary_expression"
|
|
3560
|
+
},
|
|
3561
|
+
{
|
|
3562
|
+
"type": "SYMBOL",
|
|
3563
|
+
"name": "cast_expression"
|
|
3564
|
+
}
|
|
3565
|
+
]
|
|
3541
3566
|
},
|
|
3542
3567
|
{
|
|
3543
3568
|
"type": "REPEAT",
|
|
@@ -3549,8 +3574,33 @@
|
|
|
3549
3574
|
"value": ","
|
|
3550
3575
|
},
|
|
3551
3576
|
{
|
|
3552
|
-
"type": "
|
|
3553
|
-
"
|
|
3577
|
+
"type": "CHOICE",
|
|
3578
|
+
"members": [
|
|
3579
|
+
{
|
|
3580
|
+
"type": "SYMBOL",
|
|
3581
|
+
"name": "binary_expression"
|
|
3582
|
+
},
|
|
3583
|
+
{
|
|
3584
|
+
"type": "SYMBOL",
|
|
3585
|
+
"name": "instanceof_expression"
|
|
3586
|
+
},
|
|
3587
|
+
{
|
|
3588
|
+
"type": "SYMBOL",
|
|
3589
|
+
"name": "ternary_expression"
|
|
3590
|
+
},
|
|
3591
|
+
{
|
|
3592
|
+
"type": "SYMBOL",
|
|
3593
|
+
"name": "primary_expression"
|
|
3594
|
+
},
|
|
3595
|
+
{
|
|
3596
|
+
"type": "SYMBOL",
|
|
3597
|
+
"name": "unary_expression"
|
|
3598
|
+
},
|
|
3599
|
+
{
|
|
3600
|
+
"type": "SYMBOL",
|
|
3601
|
+
"name": "cast_expression"
|
|
3602
|
+
}
|
|
3603
|
+
]
|
|
3554
3604
|
}
|
|
3555
3605
|
]
|
|
3556
3606
|
}
|
|
@@ -3595,6 +3645,18 @@
|
|
|
3595
3645
|
"type_pattern": {
|
|
3596
3646
|
"type": "SEQ",
|
|
3597
3647
|
"members": [
|
|
3648
|
+
{
|
|
3649
|
+
"type": "CHOICE",
|
|
3650
|
+
"members": [
|
|
3651
|
+
{
|
|
3652
|
+
"type": "SYMBOL",
|
|
3653
|
+
"name": "modifiers"
|
|
3654
|
+
},
|
|
3655
|
+
{
|
|
3656
|
+
"type": "BLANK"
|
|
3657
|
+
}
|
|
3658
|
+
]
|
|
3659
|
+
},
|
|
3598
3660
|
{
|
|
3599
3661
|
"type": "SYMBOL",
|
|
3600
3662
|
"name": "_unannotated_type"
|
|
@@ -3763,8 +3825,45 @@
|
|
|
3763
3825
|
"value": "when"
|
|
3764
3826
|
},
|
|
3765
3827
|
{
|
|
3766
|
-
"type": "
|
|
3767
|
-
"
|
|
3828
|
+
"type": "CHOICE",
|
|
3829
|
+
"members": [
|
|
3830
|
+
{
|
|
3831
|
+
"type": "SYMBOL",
|
|
3832
|
+
"name": "assignment_expression"
|
|
3833
|
+
},
|
|
3834
|
+
{
|
|
3835
|
+
"type": "SYMBOL",
|
|
3836
|
+
"name": "binary_expression"
|
|
3837
|
+
},
|
|
3838
|
+
{
|
|
3839
|
+
"type": "SYMBOL",
|
|
3840
|
+
"name": "instanceof_expression"
|
|
3841
|
+
},
|
|
3842
|
+
{
|
|
3843
|
+
"type": "SYMBOL",
|
|
3844
|
+
"name": "ternary_expression"
|
|
3845
|
+
},
|
|
3846
|
+
{
|
|
3847
|
+
"type": "SYMBOL",
|
|
3848
|
+
"name": "update_expression"
|
|
3849
|
+
},
|
|
3850
|
+
{
|
|
3851
|
+
"type": "SYMBOL",
|
|
3852
|
+
"name": "primary_expression"
|
|
3853
|
+
},
|
|
3854
|
+
{
|
|
3855
|
+
"type": "SYMBOL",
|
|
3856
|
+
"name": "unary_expression"
|
|
3857
|
+
},
|
|
3858
|
+
{
|
|
3859
|
+
"type": "SYMBOL",
|
|
3860
|
+
"name": "cast_expression"
|
|
3861
|
+
},
|
|
3862
|
+
{
|
|
3863
|
+
"type": "SYMBOL",
|
|
3864
|
+
"name": "switch_expression"
|
|
3865
|
+
}
|
|
3866
|
+
]
|
|
3768
3867
|
}
|
|
3769
3868
|
]
|
|
3770
3869
|
},
|
|
@@ -5262,8 +5361,12 @@
|
|
|
5262
5361
|
"value": "with"
|
|
5263
5362
|
},
|
|
5264
5363
|
{
|
|
5265
|
-
"type": "
|
|
5266
|
-
"name": "
|
|
5364
|
+
"type": "FIELD",
|
|
5365
|
+
"name": "provider",
|
|
5366
|
+
"content": {
|
|
5367
|
+
"type": "SYMBOL",
|
|
5368
|
+
"name": "_name"
|
|
5369
|
+
}
|
|
5267
5370
|
},
|
|
5268
5371
|
{
|
|
5269
5372
|
"type": "REPEAT",
|
|
@@ -7742,6 +7845,9 @@
|
|
|
7742
7845
|
}
|
|
7743
7846
|
],
|
|
7744
7847
|
"conflicts": [
|
|
7848
|
+
[
|
|
7849
|
+
"modifiers"
|
|
7850
|
+
],
|
|
7745
7851
|
[
|
|
7746
7852
|
"modifiers",
|
|
7747
7853
|
"annotated_type",
|
package/src/node-types.json
CHANGED
|
@@ -2139,7 +2139,39 @@
|
|
|
2139
2139
|
"required": true,
|
|
2140
2140
|
"types": [
|
|
2141
2141
|
{
|
|
2142
|
-
"type": "
|
|
2142
|
+
"type": "assignment_expression",
|
|
2143
|
+
"named": true
|
|
2144
|
+
},
|
|
2145
|
+
{
|
|
2146
|
+
"type": "binary_expression",
|
|
2147
|
+
"named": true
|
|
2148
|
+
},
|
|
2149
|
+
{
|
|
2150
|
+
"type": "cast_expression",
|
|
2151
|
+
"named": true
|
|
2152
|
+
},
|
|
2153
|
+
{
|
|
2154
|
+
"type": "instanceof_expression",
|
|
2155
|
+
"named": true
|
|
2156
|
+
},
|
|
2157
|
+
{
|
|
2158
|
+
"type": "primary_expression",
|
|
2159
|
+
"named": true
|
|
2160
|
+
},
|
|
2161
|
+
{
|
|
2162
|
+
"type": "switch_expression",
|
|
2163
|
+
"named": true
|
|
2164
|
+
},
|
|
2165
|
+
{
|
|
2166
|
+
"type": "ternary_expression",
|
|
2167
|
+
"named": true
|
|
2168
|
+
},
|
|
2169
|
+
{
|
|
2170
|
+
"type": "unary_expression",
|
|
2171
|
+
"named": true
|
|
2172
|
+
},
|
|
2173
|
+
{
|
|
2174
|
+
"type": "update_expression",
|
|
2143
2175
|
"named": true
|
|
2144
2176
|
}
|
|
2145
2177
|
]
|
|
@@ -2258,11 +2290,21 @@
|
|
|
2258
2290
|
"required": false,
|
|
2259
2291
|
"types": [
|
|
2260
2292
|
{
|
|
2261
|
-
"type": "
|
|
2293
|
+
"type": "_unannotated_type",
|
|
2262
2294
|
"named": true
|
|
2263
2295
|
}
|
|
2264
2296
|
]
|
|
2265
2297
|
}
|
|
2298
|
+
},
|
|
2299
|
+
"children": {
|
|
2300
|
+
"multiple": false,
|
|
2301
|
+
"required": false,
|
|
2302
|
+
"types": [
|
|
2303
|
+
{
|
|
2304
|
+
"type": "modifiers",
|
|
2305
|
+
"named": true
|
|
2306
|
+
}
|
|
2307
|
+
]
|
|
2266
2308
|
}
|
|
2267
2309
|
},
|
|
2268
2310
|
{
|
|
@@ -2961,7 +3003,7 @@
|
|
|
2961
3003
|
},
|
|
2962
3004
|
"provider": {
|
|
2963
3005
|
"multiple": true,
|
|
2964
|
-
"required":
|
|
3006
|
+
"required": true,
|
|
2965
3007
|
"types": [
|
|
2966
3008
|
{
|
|
2967
3009
|
"type": "identifier",
|
|
@@ -2973,20 +3015,6 @@
|
|
|
2973
3015
|
}
|
|
2974
3016
|
]
|
|
2975
3017
|
}
|
|
2976
|
-
},
|
|
2977
|
-
"children": {
|
|
2978
|
-
"multiple": false,
|
|
2979
|
-
"required": true,
|
|
2980
|
-
"types": [
|
|
2981
|
-
{
|
|
2982
|
-
"type": "identifier",
|
|
2983
|
-
"named": true
|
|
2984
|
-
},
|
|
2985
|
-
{
|
|
2986
|
-
"type": "scoped_identifier",
|
|
2987
|
-
"named": true
|
|
2988
|
-
}
|
|
2989
|
-
]
|
|
2990
3018
|
}
|
|
2991
3019
|
},
|
|
2992
3020
|
{
|
|
@@ -3563,16 +3591,36 @@
|
|
|
3563
3591
|
"required": false,
|
|
3564
3592
|
"types": [
|
|
3565
3593
|
{
|
|
3566
|
-
"type": "
|
|
3594
|
+
"type": "binary_expression",
|
|
3595
|
+
"named": true
|
|
3596
|
+
},
|
|
3597
|
+
{
|
|
3598
|
+
"type": "cast_expression",
|
|
3567
3599
|
"named": true
|
|
3568
3600
|
},
|
|
3569
3601
|
{
|
|
3570
3602
|
"type": "guard",
|
|
3571
3603
|
"named": true
|
|
3572
3604
|
},
|
|
3605
|
+
{
|
|
3606
|
+
"type": "instanceof_expression",
|
|
3607
|
+
"named": true
|
|
3608
|
+
},
|
|
3573
3609
|
{
|
|
3574
3610
|
"type": "pattern",
|
|
3575
3611
|
"named": true
|
|
3612
|
+
},
|
|
3613
|
+
{
|
|
3614
|
+
"type": "primary_expression",
|
|
3615
|
+
"named": true
|
|
3616
|
+
},
|
|
3617
|
+
{
|
|
3618
|
+
"type": "ternary_expression",
|
|
3619
|
+
"named": true
|
|
3620
|
+
},
|
|
3621
|
+
{
|
|
3622
|
+
"type": "unary_expression",
|
|
3623
|
+
"named": true
|
|
3576
3624
|
}
|
|
3577
3625
|
]
|
|
3578
3626
|
}
|
|
@@ -3898,6 +3946,10 @@
|
|
|
3898
3946
|
{
|
|
3899
3947
|
"type": "identifier",
|
|
3900
3948
|
"named": true
|
|
3949
|
+
},
|
|
3950
|
+
{
|
|
3951
|
+
"type": "modifiers",
|
|
3952
|
+
"named": true
|
|
3901
3953
|
}
|
|
3902
3954
|
]
|
|
3903
3955
|
}
|