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

Commit 08bb01a

Browse files
BFergersonDenys Smirnov
authored andcommitted
Add Operator Role (#62)
* - Added Operator role Signed-off-by: chess-equality <[email protected]>
1 parent deaaca6 commit 08bb01a

File tree

106 files changed

+1553
-1553
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+1553
-1553
lines changed

driver/normalizer/annotation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ var Annotations = []Mapping{
266266
"Prop_Operand2": ObjectRoles("operand2", role.Binary, role.Expression, role.Right),
267267
"Prop_InitOperand2": ObjectRoles("init_operand2", role.Binary, role.Expression, role.Right,
268268
role.Initialization, role.Incomplete),
269-
}), LookupArrOpVar("operator", binaryExprRoles)),
269+
}), LookupArrOpVar("operator", binaryExprRoles), role.Operator),
270270

271271
AnnotateType("CPPASTEqualsInitializer", nil, role.Declaration, role.Assignment,
272272
role.Expression, role.Right),

fixtures/_integration.cpp.legacy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ CPPASTTranslationUnit {
158158
. . . . . . . }
159159
. . . . . . . Children: {
160160
. . . . . . . . 0: CPPASTBinaryExpression {
161-
. . . . . . . . . Roles: Binary,Expression,Bitwise,LeftShift
161+
. . . . . . . . . Roles: Binary,Expression,Bitwise,LeftShift,Operator
162162
. . . . . . . . . TOKEN "<<"
163163
. . . . . . . . . StartPosition: {
164164
. . . . . . . . . . Offset: 38

fixtures/_integration.cpp.sem.uast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
},
6767
'Prop_Expression': { '@type': "cpp:CPPASTBinaryExpression",
6868
'@token': "<<",
69-
'@role': [Binary, Bitwise, Expression, LeftShift],
69+
'@role': [Binary, Bitwise, Expression, LeftShift, Operator],
7070
'@pos': { '@type': "uast:Positions",
7171
start: { '@type': "uast:Position",
7272
offset: 38,

fixtures/_integration.cpp.uast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
},
6262
'Prop_Expression': { '@type': "CPPASTBinaryExpression",
6363
'@token': "<<",
64-
'@role': [Binary, Bitwise, Expression, LeftShift],
64+
'@role': [Binary, Bitwise, Expression, LeftShift, Operator],
6565
'@pos': { '@type': "uast:Positions",
6666
start: { '@type': "uast:Position",
6767
offset: 38,

fixtures/arithmeticops.cpp.sem.uast

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
},
6767
'Prop_Expression': { '@type': "cpp:CPPASTBinaryExpression",
6868
'@token': "+",
69-
'@role': [Add, Arithmetic, Binary, Expression],
69+
'@role': [Add, Arithmetic, Binary, Expression, Operator],
7070
'@pos': { '@type': "uast:Positions",
7171
start: { '@type': "uast:Position",
7272
offset: 15,
@@ -160,7 +160,7 @@
160160
},
161161
'Prop_Expression': { '@type': "cpp:CPPASTBinaryExpression",
162162
'@token': "-",
163-
'@role': [Arithmetic, Binary, Expression, Substract],
163+
'@role': [Arithmetic, Binary, Expression, Operator, Substract],
164164
'@pos': { '@type': "uast:Positions",
165165
start: { '@type': "uast:Position",
166166
offset: 22,
@@ -254,7 +254,7 @@
254254
},
255255
'Prop_Expression': { '@type': "cpp:CPPASTBinaryExpression",
256256
'@token': "*",
257-
'@role': [Arithmetic, Binary, Expression, Multiply],
257+
'@role': [Arithmetic, Binary, Expression, Multiply, Operator],
258258
'@pos': { '@type': "uast:Positions",
259259
start: { '@type': "uast:Position",
260260
offset: 29,
@@ -348,7 +348,7 @@
348348
},
349349
'Prop_Expression': { '@type': "cpp:CPPASTBinaryExpression",
350350
'@token': "/",
351-
'@role': [Arithmetic, Binary, Divide, Expression],
351+
'@role': [Arithmetic, Binary, Divide, Expression, Operator],
352352
'@pos': { '@type': "uast:Positions",
353353
start: { '@type': "uast:Position",
354354
offset: 36,
@@ -442,7 +442,7 @@
442442
},
443443
'Prop_Expression': { '@type': "cpp:CPPASTBinaryExpression",
444444
'@token': "%",
445-
'@role': [Arithmetic, Binary, Expression, Modulo],
445+
'@role': [Arithmetic, Binary, Expression, Modulo, Operator],
446446
'@pos': { '@type': "uast:Positions",
447447
start: { '@type': "uast:Position",
448448
offset: 43,
@@ -956,7 +956,7 @@
956956
},
957957
'Prop_Expression': { '@type': "cpp:CPPASTBinaryExpression",
958958
'@token': "+=",
959-
'@role': [Add, Arithmetic, Assignment, Binary, Expression],
959+
'@role': [Add, Arithmetic, Assignment, Binary, Expression, Operator],
960960
'@pos': { '@type': "uast:Positions",
961961
start: { '@type': "uast:Position",
962962
offset: 91,
@@ -1063,7 +1063,7 @@
10631063
},
10641064
'Prop_Expression': { '@type': "cpp:CPPASTBinaryExpression",
10651065
'@token': "-=",
1066-
'@role': [Arithmetic, Assignment, Binary, Expression, Substract],
1066+
'@role': [Arithmetic, Assignment, Binary, Expression, Operator, Substract],
10671067
'@pos': { '@type': "uast:Positions",
10681068
start: { '@type': "uast:Position",
10691069
offset: 99,
@@ -1170,7 +1170,7 @@
11701170
},
11711171
'Prop_Expression': { '@type': "cpp:CPPASTBinaryExpression",
11721172
'@token': "/=",
1173-
'@role': [Arithmetic, Assignment, Binary, Divide, Expression],
1173+
'@role': [Arithmetic, Assignment, Binary, Divide, Expression, Operator],
11741174
'@pos': { '@type': "uast:Positions",
11751175
start: { '@type': "uast:Position",
11761176
offset: 107,
@@ -1277,7 +1277,7 @@
12771277
},
12781278
'Prop_Expression': { '@type': "cpp:CPPASTBinaryExpression",
12791279
'@token': "*=",
1280-
'@role': [Arithmetic, Assignment, Binary, Expression, Multiply],
1280+
'@role': [Arithmetic, Assignment, Binary, Expression, Multiply, Operator],
12811281
'@pos': { '@type': "uast:Positions",
12821282
start: { '@type': "uast:Position",
12831283
offset: 115,
@@ -1384,7 +1384,7 @@
13841384
},
13851385
'Prop_Expression': { '@type': "cpp:CPPASTBinaryExpression",
13861386
'@token': "%=",
1387-
'@role': [Arithmetic, Assignment, Binary, Expression, Modulo],
1387+
'@role': [Arithmetic, Assignment, Binary, Expression, Modulo, Operator],
13881388
'@pos': { '@type': "uast:Positions",
13891389
start: { '@type': "uast:Position",
13901390
offset: 123,

fixtures/arithmeticops.cpp.uast

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
},
6262
'Prop_Expression': { '@type': "CPPASTBinaryExpression",
6363
'@token': "+",
64-
'@role': [Add, Arithmetic, Binary, Expression],
64+
'@role': [Add, Arithmetic, Binary, Expression, Operator],
6565
'@pos': { '@type': "uast:Positions",
6666
start: { '@type': "uast:Position",
6767
offset: 15,
@@ -155,7 +155,7 @@
155155
},
156156
'Prop_Expression': { '@type': "CPPASTBinaryExpression",
157157
'@token': "-",
158-
'@role': [Arithmetic, Binary, Expression, Substract],
158+
'@role': [Arithmetic, Binary, Expression, Operator, Substract],
159159
'@pos': { '@type': "uast:Positions",
160160
start: { '@type': "uast:Position",
161161
offset: 22,
@@ -249,7 +249,7 @@
249249
},
250250
'Prop_Expression': { '@type': "CPPASTBinaryExpression",
251251
'@token': "*",
252-
'@role': [Arithmetic, Binary, Expression, Multiply],
252+
'@role': [Arithmetic, Binary, Expression, Multiply, Operator],
253253
'@pos': { '@type': "uast:Positions",
254254
start: { '@type': "uast:Position",
255255
offset: 29,
@@ -343,7 +343,7 @@
343343
},
344344
'Prop_Expression': { '@type': "CPPASTBinaryExpression",
345345
'@token': "/",
346-
'@role': [Arithmetic, Binary, Divide, Expression],
346+
'@role': [Arithmetic, Binary, Divide, Expression, Operator],
347347
'@pos': { '@type': "uast:Positions",
348348
start: { '@type': "uast:Position",
349349
offset: 36,
@@ -437,7 +437,7 @@
437437
},
438438
'Prop_Expression': { '@type': "CPPASTBinaryExpression",
439439
'@token': "%",
440-
'@role': [Arithmetic, Binary, Expression, Modulo],
440+
'@role': [Arithmetic, Binary, Expression, Modulo, Operator],
441441
'@pos': { '@type': "uast:Positions",
442442
start: { '@type': "uast:Position",
443443
offset: 43,
@@ -956,7 +956,7 @@
956956
},
957957
'Prop_Expression': { '@type': "CPPASTBinaryExpression",
958958
'@token': "+=",
959-
'@role': [Add, Arithmetic, Assignment, Binary, Expression],
959+
'@role': [Add, Arithmetic, Assignment, Binary, Expression, Operator],
960960
'@pos': { '@type': "uast:Positions",
961961
start: { '@type': "uast:Position",
962962
offset: 91,
@@ -1064,7 +1064,7 @@
10641064
},
10651065
'Prop_Expression': { '@type': "CPPASTBinaryExpression",
10661066
'@token': "-=",
1067-
'@role': [Arithmetic, Assignment, Binary, Expression, Substract],
1067+
'@role': [Arithmetic, Assignment, Binary, Expression, Operator, Substract],
10681068
'@pos': { '@type': "uast:Positions",
10691069
start: { '@type': "uast:Position",
10701070
offset: 99,
@@ -1172,7 +1172,7 @@
11721172
},
11731173
'Prop_Expression': { '@type': "CPPASTBinaryExpression",
11741174
'@token': "/=",
1175-
'@role': [Arithmetic, Assignment, Binary, Divide, Expression],
1175+
'@role': [Arithmetic, Assignment, Binary, Divide, Expression, Operator],
11761176
'@pos': { '@type': "uast:Positions",
11771177
start: { '@type': "uast:Position",
11781178
offset: 107,
@@ -1280,7 +1280,7 @@
12801280
},
12811281
'Prop_Expression': { '@type': "CPPASTBinaryExpression",
12821282
'@token': "*=",
1283-
'@role': [Arithmetic, Assignment, Binary, Expression, Multiply],
1283+
'@role': [Arithmetic, Assignment, Binary, Expression, Multiply, Operator],
12841284
'@pos': { '@type': "uast:Positions",
12851285
start: { '@type': "uast:Position",
12861286
offset: 115,
@@ -1388,7 +1388,7 @@
13881388
},
13891389
'Prop_Expression': { '@type': "CPPASTBinaryExpression",
13901390
'@token': "%=",
1391-
'@role': [Arithmetic, Assignment, Binary, Expression, Modulo],
1391+
'@role': [Arithmetic, Assignment, Binary, Expression, Modulo, Operator],
13921392
'@pos': { '@type': "uast:Positions",
13931393
start: { '@type': "uast:Position",
13941394
offset: 123,

fixtures/array.cpp.sem.uast

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@
931931
},
932932
'Prop_Expression': { '@type': "cpp:CPPASTBinaryExpression",
933933
'@token': "=",
934-
'@role': [Assignment, Binary, Expression],
934+
'@role': [Assignment, Binary, Expression, Operator],
935935
'@pos': { '@type': "uast:Positions",
936936
start: { '@type': "uast:Position",
937937
offset: 76,
@@ -1390,7 +1390,7 @@
13901390
},
13911391
'Prop_Expression': { '@type': "cpp:CPPASTBinaryExpression",
13921392
'@token': "=",
1393-
'@role': [Assignment, Binary, Expression],
1393+
'@role': [Assignment, Binary, Expression, Operator],
13941394
'@pos': { '@type': "uast:Positions",
13951395
start: { '@type': "uast:Position",
13961396
offset: 104,

fixtures/array.cpp.uast

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@
929929
},
930930
'Prop_Expression': { '@type': "CPPASTBinaryExpression",
931931
'@token': "=",
932-
'@role': [Assignment, Binary, Expression],
932+
'@role': [Assignment, Binary, Expression, Operator],
933933
'@pos': { '@type': "uast:Positions",
934934
start: { '@type': "uast:Position",
935935
offset: 76,
@@ -1392,7 +1392,7 @@
13921392
},
13931393
'Prop_Expression': { '@type': "CPPASTBinaryExpression",
13941394
'@token': "=",
1395-
'@role': [Assignment, Binary, Expression],
1395+
'@role': [Assignment, Binary, Expression, Operator],
13961396
'@pos': { '@type': "uast:Positions",
13971397
start: { '@type': "uast:Position",
13981398
offset: 104,

0 commit comments

Comments
 (0)