Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit deaaca6

Browse files
BFergersonDenys Smirnov
authored andcommitted
Missing CPPASTRangeBasedForStatement roles (#58)
* Add missing roles for CPPASTRangeBasedForStatement Signed-off-by: Brandon Fergerson <[email protected]>
1 parent 7654fbf commit deaaca6

11 files changed

+30
-30
lines changed

driver/normalizer/annotation.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,10 @@ var Annotations = []Mapping{
348348
}, role.For, role.Statement),
349349

350350
AnnotateType("CPPASTRangeBasedForStatement", ObjRoles{
351-
"Prop_Body": {role.For},
351+
"Prop_Body": {role.For, role.Body},
352352
"Prop_Declaration": {role.For, role.Declaration, role.Variable},
353353
"Prop_InitializerClause": {role.For, role.Iterator},
354-
}, role.For, role.Statement),
354+
}, role.For, role.Iterator, role.Statement),
355355

356356
AnnotateType("CPPASTIfStatement", ObjRoles{
357357
"Prop_ThenClause": {role.If, role.Then},

fixtures/bench_n_queens.cpp.sem.uast

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3951,7 +3951,7 @@
39513951
},
39523952
Statements: [
39533953
{ '@type': "cpp:CPPASTRangeBasedForStatement",
3954-
'@role': [For, Statement],
3954+
'@role': [For, Iterator, Statement],
39553955
'@pos': { '@type': "uast:Positions",
39563956
start: { '@type': "uast:Position",
39573957
offset: 1526,
@@ -3965,7 +3965,7 @@
39653965
},
39663966
},
39673967
'Prop_Body': { '@type': "cpp:CPPASTExpressionStatement",
3968-
'@role': [Expression, For],
3968+
'@role': [Body, Expression, For],
39693969
'@pos': { '@type': "uast:Positions",
39703970
start: { '@type': "uast:Position",
39713971
offset: 1548,
@@ -16645,7 +16645,7 @@
1664516645
},
1664616646
},
1664716647
{ '@type': "cpp:CPPASTRangeBasedForStatement",
16648-
'@role': [For, Statement],
16648+
'@role': [For, Iterator, Statement],
1664916649
'@pos': { '@type': "uast:Positions",
1665016650
start: { '@type': "uast:Position",
1665116651
offset: 4797,
@@ -16680,7 +16680,7 @@
1668016680
},
1668116681
],
1668216682
'Prop_Body': { '@type': "uast:Block",
16683-
'@role': [For],
16683+
'@role': [Body, For],
1668416684
'@pos': { '@type': "uast:Positions",
1668516685
start: { '@type': "uast:Position",
1668616686
offset: 4829,
@@ -19090,7 +19090,7 @@
1909019090
},
1909119091
},
1909219092
{ '@type': "cpp:CPPASTRangeBasedForStatement",
19093-
'@role': [For, Statement],
19093+
'@role': [For, Iterator, Statement],
1909419094
'@pos': { '@type': "uast:Positions",
1909519095
start: { '@type': "uast:Position",
1909619096
offset: 5406,
@@ -19104,7 +19104,7 @@
1910419104
},
1910519105
},
1910619106
'Prop_Body': { '@type': "uast:Block",
19107-
'@role': [For],
19107+
'@role': [Body, For],
1910819108
'@pos': { '@type': "uast:Positions",
1910919109
start: { '@type': "uast:Position",
1911019110
offset: 5444,

fixtures/bench_n_queens.cpp.uast

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5265,7 +5265,7 @@
52655265
},
52665266
'Prop_Statements': [
52675267
{ '@type': "CPPASTRangeBasedForStatement",
5268-
'@role': [For, Statement],
5268+
'@role': [For, Iterator, Statement],
52695269
'@pos': { '@type': "uast:Positions",
52705270
start: { '@type': "uast:Position",
52715271
offset: 1526,
@@ -5279,7 +5279,7 @@
52795279
},
52805280
},
52815281
'Prop_Body': { '@type': "CPPASTExpressionStatement",
5282-
'@role': [Expression, For],
5282+
'@role': [Body, Expression, For],
52835283
'@pos': { '@type': "uast:Positions",
52845284
start: { '@type': "uast:Position",
52855285
offset: 1548,
@@ -19223,7 +19223,7 @@
1922319223
},
1922419224
},
1922519225
{ '@type': "CPPASTRangeBasedForStatement",
19226-
'@role': [For, Statement],
19226+
'@role': [For, Iterator, Statement],
1922719227
'@pos': { '@type': "uast:Positions",
1922819228
start: { '@type': "uast:Position",
1922919229
offset: 4797,
@@ -21975,7 +21975,7 @@
2197521975
},
2197621976
},
2197721977
{ '@type': "CPPASTRangeBasedForStatement",
21978-
'@role': [For, Statement],
21978+
'@role': [For, Iterator, Statement],
2197921979
'@pos': { '@type': "uast:Positions",
2198021980
start: { '@type': "uast:Position",
2198121981
offset: 5406,

fixtures/bench_pangram.cpp.sem.uast

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,7 +2153,7 @@
21532153
},
21542154
},
21552155
{ '@type': "cpp:CPPASTRangeBasedForStatement",
2156-
'@role': [For, Statement],
2156+
'@role': [For, Iterator, Statement],
21572157
'@pos': { '@type': "uast:Positions",
21582158
start: { '@type': "uast:Position",
21592159
offset: 562,
@@ -2167,7 +2167,7 @@
21672167
},
21682168
},
21692169
'Prop_Body': { '@type': "uast:Block",
2170-
'@role': [For],
2170+
'@role': [Body, For],
21712171
'@pos': { '@type': "uast:Positions",
21722172
start: { '@type': "uast:Position",
21732173
offset: 590,

fixtures/bench_pangram.cpp.uast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2697,7 +2697,7 @@
26972697
},
26982698
},
26992699
{ '@type': "CPPASTRangeBasedForStatement",
2700-
'@role': [For, Statement],
2700+
'@role': [For, Iterator, Statement],
27012701
'@pos': { '@type': "uast:Positions",
27022702
start: { '@type': "uast:Position",
27032703
offset: 562,

fixtures/bench_server.cpp.sem.uast

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64679,7 +64679,7 @@
6467964679
},
6468064680
},
6468164681
{ '@type': "cpp:CPPASTRangeBasedForStatement",
64682-
'@role': [For, Statement],
64682+
'@role': [For, Iterator, Statement],
6468364683
'@pos': { '@type': "uast:Positions",
6468464684
start: { '@type': "uast:Position",
6468564685
offset: 23186,
@@ -64693,7 +64693,7 @@
6469364693
},
6469464694
},
6469564695
'Prop_Body': { '@type': "uast:Block",
64696-
'@role': [For],
64696+
'@role': [Body, For],
6469764697
'@pos': { '@type': "uast:Positions",
6469864698
start: { '@type': "uast:Position",
6469964699
offset: 23227,
@@ -91477,7 +91477,7 @@
9147791477
},
9147891478
},
9147991479
{ '@type': "cpp:CPPASTRangeBasedForStatement",
91480-
'@role': [For, Statement],
91480+
'@role': [For, Iterator, Statement],
9148191481
'@pos': { '@type': "uast:Positions",
9148291482
start: { '@type': "uast:Position",
9148391483
offset: 30893,
@@ -91491,7 +91491,7 @@
9149191491
},
9149291492
},
9149391493
'Prop_Body': { '@type': "uast:Block",
91494-
'@role': [For],
91494+
'@role': [Body, For],
9149591495
'@pos': { '@type': "uast:Positions",
9149691496
start: { '@type': "uast:Position",
9149791497
offset: 30928,

fixtures/bench_server.cpp.uast

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90233,7 +90233,7 @@
9023390233
},
9023490234
},
9023590235
{ '@type': "CPPASTRangeBasedForStatement",
90236-
'@role': [For, Statement],
90236+
'@role': [For, Iterator, Statement],
9023790237
'@pos': { '@type': "uast:Positions",
9023890238
start: { '@type': "uast:Position",
9023990239
offset: 23186,
@@ -126907,7 +126907,7 @@
126907126907
},
126908126908
},
126909126909
{ '@type': "CPPASTRangeBasedForStatement",
126910-
'@role': [For, Statement],
126910+
'@role': [For, Iterator, Statement],
126911126911
'@pos': { '@type': "uast:Positions",
126912126912
start: { '@type': "uast:Position",
126913126913
offset: 30893,

fixtures/cpp17_2.cpp.sem.uast

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50669,7 +50669,7 @@
5066950669
},
5067050670
},
5067150671
{ '@type': "cpp:CPPASTRangeBasedForStatement",
50672-
'@role': [For, Statement],
50672+
'@role': [For, Iterator, Statement],
5067350673
'@pos': { '@type': "uast:Positions",
5067450674
start: { '@type': "uast:Position",
5067550675
offset: 11568,
@@ -50683,7 +50683,7 @@
5068350683
},
5068450684
},
5068550685
'Prop_Body': { '@type': "uast:Block",
50686-
'@role': [For],
50686+
'@role': [Body, For],
5068750687
'@pos': { '@type': "uast:Positions",
5068850688
start: { '@type': "uast:Position",
5068950689
offset: 11607,

fixtures/cpp17_2.cpp.uast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58069,7 +58069,7 @@
5806958069
},
5807058070
},
5807158071
{ '@type': "CPPASTRangeBasedForStatement",
58072-
'@role': [For, Statement],
58072+
'@role': [For, Iterator, Statement],
5807358073
'@pos': { '@type': "uast:Positions",
5807458074
start: { '@type': "uast:Position",
5807558075
offset: 11568,

fixtures/cpp17_3.cpp.sem.uast

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21746,7 +21746,7 @@
2174621746
},
2174721747
Statements: [
2174821748
{ '@type': "cpp:CPPASTRangeBasedForStatement",
21749-
'@role': [For, Statement],
21749+
'@role': [For, Iterator, Statement],
2175021750
'@pos': { '@type': "uast:Positions",
2175121751
start: { '@type': "uast:Position",
2175221752
offset: 9952,
@@ -21760,7 +21760,7 @@
2176021760
},
2176121761
},
2176221762
'Prop_Body': { '@type': "uast:Block",
21763-
'@role': [For],
21763+
'@role': [Body, For],
2176421764
'@pos': { '@type': "uast:Positions",
2176521765
start: { '@type': "uast:Position",
2176621766
offset: 10008,
@@ -66089,7 +66089,7 @@
6608966089
},
6609066090
Statements: [
6609166091
{ '@type': "cpp:CPPASTRangeBasedForStatement",
66092-
'@role': [For, Statement],
66092+
'@role': [For, Iterator, Statement],
6609366093
'@pos': { '@type': "uast:Positions",
6609466094
start: { '@type': "uast:Position",
6609566095
offset: 25525,
@@ -66103,7 +66103,7 @@
6610366103
},
6610466104
},
6610566105
'Prop_Body': { '@type': "uast:Block",
66106-
'@role': [For],
66106+
'@role': [Body, For],
6610766107
'@pos': { '@type': "uast:Positions",
6610866108
start: { '@type': "uast:Position",
6610966109
offset: 25568,

0 commit comments

Comments
 (0)