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

Commit 7654fbf

Browse files
BFergersonDenys Smirnov
authored andcommitted
CPPASTDoStatement should have DoWhile role (#57)
CPPASTDoStatement should have `DoWhile` role Signed-off-by: Brandon Fergerson <[email protected]>
1 parent 7825bee commit 7654fbf

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

driver/normalizer/annotation.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,9 @@ var Annotations = []Mapping{
325325
}, role.Statement, role.While),
326326

327327
AnnotateType("CPPASTDoStatement", ObjRoles{
328-
"Prop_Body": {role.While},
329-
"Prop_Condition": {role.While, role.Condition},
330-
}, role.Statement, role.While),
328+
"Prop_Body": {role.DoWhile},
329+
"Prop_Condition": {role.DoWhile, role.Condition},
330+
}, role.Statement, role.DoWhile),
331331

332332
AnnotateType("CPPASTSwitchStatement", ObjRoles{
333333
"Prop_Body": {role.Switch},

fixtures/do_while.cpp.sem.uast

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
},
204204
},
205205
{ '@type': "cpp:CPPASTDoStatement",
206-
'@role': [Statement, While],
206+
'@role': [DoWhile, Statement],
207207
'@pos': { '@type': "uast:Positions",
208208
start: { '@type': "uast:Position",
209209
offset: 30,
@@ -217,7 +217,7 @@
217217
},
218218
},
219219
'Prop_Body': { '@type': "uast:Block",
220-
'@role': [While],
220+
'@role': [DoWhile],
221221
'@pos': { '@type': "uast:Positions",
222222
start: { '@type': "uast:Position",
223223
offset: 33,
@@ -479,7 +479,7 @@
479479
},
480480
'Prop_Condition': { '@type': "cpp:CPPASTBinaryExpression",
481481
'@token': "<=",
482-
'@role': [Binary, Condition, Expression, LessThanOrEqual, Relational, While],
482+
'@role': [Binary, Condition, DoWhile, Expression, LessThanOrEqual, Relational],
483483
'@pos': { '@type': "uast:Positions",
484484
start: { '@type': "uast:Position",
485485
offset: 95,

fixtures/do_while.cpp.uast

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@
199199
},
200200
},
201201
{ '@type': "CPPASTDoStatement",
202-
'@role': [Statement, While],
202+
'@role': [DoWhile, Statement],
203203
'@pos': { '@type': "uast:Positions",
204204
start: { '@type': "uast:Position",
205205
offset: 30,
@@ -213,7 +213,7 @@
213213
},
214214
},
215215
'Prop_Body': { '@type': "CPPASTCompoundStatement",
216-
'@role': [Body, While],
216+
'@role': [Body, DoWhile],
217217
'@pos': { '@type': "uast:Positions",
218218
start: { '@type': "uast:Position",
219219
offset: 33,
@@ -477,7 +477,7 @@
477477
},
478478
'Prop_Condition': { '@type': "CPPASTBinaryExpression",
479479
'@token': "<=",
480-
'@role': [Binary, Condition, Expression, LessThanOrEqual, Relational, While],
480+
'@role': [Binary, Condition, DoWhile, Expression, LessThanOrEqual, Relational],
481481
'@pos': { '@type': "uast:Positions",
482482
start: { '@type': "uast:Position",
483483
offset: 95,

0 commit comments

Comments
 (0)