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

Commit df5f285

Browse files
author
Juanjo Alvarez
committed
Duplicate two more annotations with optional arrays
Signed-off-by: Juanjo Alvarez <[email protected]>
1 parent c16f03d commit df5f285

File tree

3 files changed

+24
-14
lines changed

3 files changed

+24
-14
lines changed

driver/normalizer/annotation.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,12 @@ var Annotations = []Mapping{
251251
AnnotateType("CPPASTCompositeTypeSpecifier", FieldRoles{
252252
"Key": {Op: String("union")},
253253
"Prop_Members": {Arr: true, Roles: role.Roles{role.Declaration, role.Type, role.Incomplete}},
254-
//"Prop_Clauses": {Arr: true, Roles: role.Roles{role.Declaration, role.Type, role.Incomplete}},
254+
"Prop_Clauses": {Arr: true, Roles: role.Roles{role.Declaration, role.Type, role.Incomplete}},
255+
} , role.Declaration, role.Type, role.Incomplete),
256+
257+
AnnotateType("CPPASTCompositeTypeSpecifier", FieldRoles{
258+
"Key": {Op: String("union")},
259+
"Prop_Members": {Arr: true, Roles: role.Roles{role.Declaration, role.Type, role.Incomplete}},
255260
} , role.Declaration, role.Type, role.Incomplete),
256261

257262
AnnotateType("CPPASTCompositeTypeSpecifier", FieldRoles{
@@ -317,7 +322,12 @@ var Annotations = []Mapping{
317322
AnnotateType("CPPASTLambdaExpression", FieldRoles{
318323
"Prop_Body": { Roles: role.Roles{role.Function, role.Declaration}},
319324
"Prop_Declarator": { Roles: role.Roles{role.Function, role.Declaration, role.Type}},
320-
//"Prop_Captures": {Arr: true, Roles: role.Roles{role.Function, role.Declaration, role.Incomplete}},
325+
"Prop_Captures": {Arr: true, Roles: role.Roles{role.Function, role.Declaration, role.Incomplete}},
326+
}, role.Function, role.Declaration, role.Anonymous, role.Expression),
327+
328+
AnnotateType("CPPASTLambdaExpression", FieldRoles{
329+
"Prop_Body": { Roles: role.Roles{role.Function, role.Declaration}},
330+
"Prop_Declarator": { Roles: role.Roles{role.Function, role.Declaration, role.Type}},
321331
}, role.Function, role.Declaration, role.Anonymous, role.Expression),
322332

323333
AnnotateType("CPPASTArrayDeclarator", FieldRoles{

fixtures/u2_func_anonymous.cpp.sem.uast

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,7 @@
14631463
'Prop_Captures': [
14641464
{ '@type': "cpp:CPPASTName",
14651465
'@token': "a",
1466-
'@role': [Identifier],
1466+
'@role': [Declaration, Function, Identifier, Incomplete],
14671467
'@pos': { '@type': "uast:Positions",
14681468
start: { '@type': "uast:Position",
14691469
offset: 156,
@@ -1829,7 +1829,7 @@
18291829
'Prop_Captures': [
18301830
{ '@type': "cpp:CPPASTName",
18311831
'@token': "a",
1832-
'@role': [Identifier],
1832+
'@role': [Declaration, Function, Identifier, Incomplete],
18331833
'@pos': { '@type': "uast:Positions",
18341834
start: { '@type': "uast:Position",
18351835
offset: 156,
@@ -2611,7 +2611,7 @@
26112611
'Prop_Captures': [
26122612
{ '@type': "cpp:CPPASTName",
26132613
'@token': "a",
2614-
'@role': [Identifier],
2614+
'@role': [Declaration, Function, Identifier, Incomplete],
26152615
'@pos': { '@type': "uast:Positions",
26162616
start: { '@type': "uast:Position",
26172617
offset: 234,
@@ -2898,7 +2898,7 @@
28982898
'Prop_Captures': [
28992899
{ '@type': "cpp:CPPASTName",
29002900
'@token': "a",
2901-
'@role': [Identifier],
2901+
'@role': [Declaration, Function, Identifier, Incomplete],
29022902
'@pos': { '@type': "uast:Positions",
29032903
start: { '@type': "uast:Position",
29042904
offset: 234,
@@ -3629,7 +3629,7 @@
36293629
'Prop_Captures': [
36303630
{ '@type': "cpp:CPPASTName",
36313631
'@token': "a",
3632-
'@role': [Identifier],
3632+
'@role': [Declaration, Function, Identifier, Incomplete],
36333633
'@pos': { '@type': "uast:Positions",
36343634
start: { '@type': "uast:Position",
36353635
offset: 307,
@@ -3916,7 +3916,7 @@
39163916
'Prop_Captures': [
39173917
{ '@type': "cpp:CPPASTName",
39183918
'@token': "a",
3919-
'@role': [Identifier],
3919+
'@role': [Declaration, Function, Identifier, Incomplete],
39203920
'@pos': { '@type': "uast:Positions",
39213921
start: { '@type': "uast:Position",
39223922
offset: 307,

fixtures/u2_func_anonymous.cpp.uast

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,7 @@
14631463
'Prop_Captures': [
14641464
{ '@type': "CPPASTName",
14651465
'@token': "a",
1466-
'@role': [Identifier],
1466+
'@role': [Declaration, Function, Identifier, Incomplete],
14671467
'@pos': { '@type': "uast:Positions",
14681468
start: { '@type': "uast:Position",
14691469
offset: 156,
@@ -1829,7 +1829,7 @@
18291829
'Prop_Captures': [
18301830
{ '@type': "CPPASTName",
18311831
'@token': "a",
1832-
'@role': [Identifier],
1832+
'@role': [Declaration, Function, Identifier, Incomplete],
18331833
'@pos': { '@type': "uast:Positions",
18341834
start: { '@type': "uast:Position",
18351835
offset: 156,
@@ -2611,7 +2611,7 @@
26112611
'Prop_Captures': [
26122612
{ '@type': "CPPASTName",
26132613
'@token': "a",
2614-
'@role': [Identifier],
2614+
'@role': [Declaration, Function, Identifier, Incomplete],
26152615
'@pos': { '@type': "uast:Positions",
26162616
start: { '@type': "uast:Position",
26172617
offset: 234,
@@ -2898,7 +2898,7 @@
28982898
'Prop_Captures': [
28992899
{ '@type': "CPPASTName",
29002900
'@token': "a",
2901-
'@role': [Identifier],
2901+
'@role': [Declaration, Function, Identifier, Incomplete],
29022902
'@pos': { '@type': "uast:Positions",
29032903
start: { '@type': "uast:Position",
29042904
offset: 234,
@@ -3629,7 +3629,7 @@
36293629
'Prop_Captures': [
36303630
{ '@type': "CPPASTName",
36313631
'@token': "a",
3632-
'@role': [Identifier],
3632+
'@role': [Declaration, Function, Identifier, Incomplete],
36333633
'@pos': { '@type': "uast:Positions",
36343634
start: { '@type': "uast:Position",
36353635
offset: 307,
@@ -3916,7 +3916,7 @@
39163916
'Prop_Captures': [
39173917
{ '@type': "CPPASTName",
39183918
'@token': "a",
3919-
'@role': [Identifier],
3919+
'@role': [Declaration, Function, Identifier, Incomplete],
39203920
'@pos': { '@type': "uast:Positions",
39213921
start: { '@type': "uast:Position",
39223922
offset: 307,

0 commit comments

Comments
 (0)