File tree 8 files changed +418867
-341727
lines changed
8 files changed +418867
-341727
lines changed Original file line number Diff line number Diff line change @@ -420,7 +420,6 @@ module.exports = function defineGrammar(dialect) {
420
420
'{' ,
421
421
repeat ( choice (
422
422
seq (
423
- repeat ( field ( 'decorator' , $ . decorator ) ) ,
424
423
$ . method_definition ,
425
424
optional ( $ . _semicolon ) ,
426
425
) ,
@@ -449,6 +448,7 @@ module.exports = function defineGrammar(dialect) {
449
448
) ,
450
449
451
450
method_definition : $ => prec . left ( seq (
451
+ repeat ( field ( 'decorator' , $ . decorator ) ) ,
452
452
optional ( $ . accessibility_modifier ) ,
453
453
optional ( 'static' ) ,
454
454
optional ( $ . override_modifier ) ,
Original file line number Diff line number Diff line change @@ -938,13 +938,13 @@ class Foo {
938
938
(class_declaration
939
939
(type_identifier)
940
940
(class_body
941
- (decorator
942
- (call_expression
943
- (identifier)
944
- (type_arguments
945
- (type_identifier))
946
- (arguments)))
947
941
(method_definition
942
+ (decorator
943
+ (call_expression
944
+ (identifier)
945
+ (type_arguments
946
+ (type_identifier))
947
+ (arguments)))
948
948
(property_identifier)
949
949
(formal_parameters)
950
950
(statement_block)))))
@@ -1000,9 +1000,9 @@ Classes with decorators
1000
1000
(type_identifier))
1001
1001
(string
1002
1002
(string_fragment)))
1003
- (decorator
1004
- (identifier))
1005
1003
(method_definition
1004
+ (decorator
1005
+ (identifier))
1006
1006
(property_identifier)
1007
1007
(formal_parameters
1008
1008
(required_parameter
@@ -1204,12 +1204,12 @@ class C {
1204
1204
(class_declaration
1205
1205
(type_identifier)
1206
1206
(class_body
1207
- (decorator
1208
- (parenthesized_expression
1209
- (member_expression
1210
- (identifier)
1211
- (property_identifier))))
1212
1207
(method_definition
1208
+ (decorator
1209
+ (parenthesized_expression
1210
+ (member_expression
1211
+ (identifier)
1212
+ (property_identifier))))
1213
1213
(property_identifier)
1214
1214
(formal_parameters)
1215
1215
(statement_block)))))
Original file line number Diff line number Diff line change 6586
6586
{
6587
6587
"type" : " SEQ" ,
6588
6588
"members" : [
6589
- {
6590
- "type" : " REPEAT" ,
6591
- "content" : {
6592
- "type" : " FIELD" ,
6593
- "name" : " decorator" ,
6594
- "content" : {
6595
- "type" : " SYMBOL" ,
6596
- "name" : " decorator"
6597
- }
6598
- }
6599
- },
6600
6589
{
6601
6590
"type" : " SYMBOL" ,
6602
6591
"name" : " method_definition"
6873
6862
"content" : {
6874
6863
"type" : " SEQ" ,
6875
6864
"members" : [
6865
+ {
6866
+ "type" : " REPEAT" ,
6867
+ "content" : {
6868
+ "type" : " FIELD" ,
6869
+ "name" : " decorator" ,
6870
+ "content" : {
6871
+ "type" : " SYMBOL" ,
6872
+ "name" : " decorator"
6873
+ }
6874
+ }
6875
+ },
6876
6876
{
6877
6877
"type" : " CHOICE" ,
6878
6878
"members" : [
Original file line number Diff line number Diff line change 1407
1407
{
1408
1408
"type" : " class_body" ,
1409
1409
"named" : true ,
1410
- "fields" : {
1411
- "decorator" : {
1412
- "multiple" : true ,
1413
- "required" : false ,
1414
- "types" : [
1415
- {
1416
- "type" : " decorator" ,
1417
- "named" : true
1418
- }
1419
- ]
1420
- }
1421
- },
1410
+ "fields" : {},
1422
1411
"children" : {
1423
1412
"multiple" : true ,
1424
1413
"required" : false ,
3686
3675
}
3687
3676
]
3688
3677
},
3678
+ "decorator" : {
3679
+ "multiple" : true ,
3680
+ "required" : false ,
3681
+ "types" : [
3682
+ {
3683
+ "type" : " decorator" ,
3684
+ "named" : true
3685
+ }
3686
+ ]
3687
+ },
3689
3688
"name" : {
3690
3689
"multiple" : false ,
3691
3690
"required" : true ,
6097
6096
},
6098
6097
{
6099
6098
"type" : " number" ,
6100
- "named" : true
6099
+ "named" : false
6101
6100
},
6102
6101
{
6103
6102
"type" : " number" ,
6104
- "named" : false
6103
+ "named" : true
6105
6104
},
6106
6105
{
6107
6106
"type" : " object" ,
You can’t perform that action at this time.
0 commit comments