@@ -130,7 +130,6 @@ var Annotations = []Mapping{
130130 AnnotateType ("internal-type" , nil , role .Incomplete ),
131131 AnnotateType ("CPPASTTranslationUnit" , nil , role .File , role .Module ),
132132 AnnotateType ("CPPASTExpressionStatement" , nil , role .Expression ),
133- // XXX isQualified field? (for both)
134133 AnnotateType ("CPPASTName" , FieldRoles {"Name" : {Rename : uast .KeyToken }},
135134 role .Identifier ),
136135 AnnotateType ("CPPASTImplicitName" , FieldRoles {"Name" : {Rename : uast .KeyToken }},
@@ -159,6 +158,7 @@ var Annotations = []Mapping{
159158 AnnotateType ("CPPASTDeleteExpression" , nil , role .Call , role .Expression , role .Incomplete ),
160159 AnnotateType ("CPPASTInitializerList" , nil , role .Initialization , role .List ),
161160 AnnotateType ("CPPASTCastExpression" , nil , role .Expression , role .Incomplete ),
161+ AnnotateType ("CPPASTDesignatedInitializer" , nil , role .Expression , role .Initialization ),
162162
163163 AnnotateTypeCustom ("CPPASTUnaryExpression" ,
164164 FieldRoles {
@@ -202,7 +202,7 @@ var Annotations = []Mapping{
202202
203203 AnnotateType ("CPPASTFunctionDeclarator" , FieldRoles {
204204 "Prop_Name" : {Roles : role.Roles {role .Function , role .Declaration , role .Name }},
205- // SDK? FIXME : adding "Opt: true" fails since Arrays can't be optional, but without it the annotation won't
205+ // SDK TODO : adding "Opt: true" fails since Arrays can't be optional, but without it the annotation won't
206206 // match, thus the duplicated annotation below
207207 "Prop_Parameters" : {Arr : true , Roles : role.Roles {role .Function , role .Declaration , role .Argument }},
208208 }, role .Function , role .Declaration ),
@@ -214,12 +214,18 @@ var Annotations = []Mapping{
214214 AnnotateType ("CPPASTReturnStatement" , ObjRoles {
215215 "Prop_ReturnArgument" : {role .Return , role .Value },
216216 }, role .Statement , role .Return ),
217- //
218- AnnotateTypeCustom ("CPPASTBinaryExpression" , FieldRoles {
219- "Operator" : {Rename : uast .KeyToken , Op : Var ("op" )},
220- "Prop_Operand1" : {Roles : role.Roles {role .Binary , role .Expression , role .Left }},
221- "Prop_Operand2" : {Roles : role.Roles {role .Binary , role .Expression , role .Left }},
222- }, LookupArrOpVar ("op" , binaryExprRoles )),
217+
218+ AnnotateTypeCustom ("CPPASTBinaryExpression" , MapObj (Obj {
219+ "Operator" : Var ("operator" ),
220+ "Prop_Operand1" : ObjectRoles ("operand1" ),
221+ "Prop_Operand2" : ObjectRoles ("operand2" ),
222+ // Temporarily using the same name to detect if those are really duplicated
223+ "Prop_InitOperand2" : ObjectRoles ("operand2" ),
224+ }, Obj {
225+ uast .KeyToken : Var ("operator" ),
226+ "Prop_Operand1" : ObjectRoles ("operand1" , role .Binary , role .Expression , role .Left ),
227+ "Prop_Operand2" : ObjectRoles ("operand2" , role .Binary , role .Expression , role .Right ),
228+ }), LookupArrOpVar ("operator" , binaryExprRoles )),
223229
224230 AnnotateType ("CPPASTEqualsInitializer" , nil , role .Declaration , role .Assignment , role .Expression , role .Right ),
225231
@@ -244,6 +250,7 @@ var Annotations = []Mapping{
244250 AnnotateType ("CPPASTCompositeTypeSpecifier" , FieldRoles {
245251 "Key" : {Op : String ("union" )},
246252 "Prop_Members" : {Arr : true , Roles : role.Roles {role .Declaration , role .Type , role .Incomplete }},
253+ //"Prop_Clauses": {Arr: true, Roles: role.Roles{role.Declaration, role.Type, role.Incomplete}},
247254 } , role .Declaration , role .Type , role .Incomplete ),
248255
249256 AnnotateType ("CPPASTCompositeTypeSpecifier" , FieldRoles {
0 commit comments