comparison dmd/StructDeclaration.d @ 13:427f8aa74d28

On the road to make Phobos compilable
author korDen
date Mon, 12 Apr 2010 16:29:33 +0400
parents 10317f0c89a5
children 0aa7d1437ada
comparison
equal deleted inserted replaced
12:832f71e6f96c 13:427f8aa74d28
143 int hasfunctions = 0; 143 int hasfunctions = 0;
144 for (i = 0; i < members.dim; i++) 144 for (i = 0; i < members.dim; i++)
145 { 145 {
146 Dsymbol s = cast(Dsymbol)members.data[i]; 146 Dsymbol s = cast(Dsymbol)members.data[i];
147 //printf("adding member '%s' to '%s'\n", s.toChars(), this.toChars()); 147 //printf("adding member '%s' to '%s'\n", s.toChars(), this.toChars());
148 s.addMember(sc, this, 1); 148 s.addMember(sc, this, true);
149 if (s.isFuncDeclaration()) 149 if (s.isFuncDeclaration())
150 hasfunctions = 1; 150 hasfunctions = 1;
151 } 151 }
152 152
153 // If nested struct, add in hidden 'this' pointer to outer scope 153 // If nested struct, add in hidden 'this' pointer to outer scope
264 e = new CallExp(loc, e, args); 264 e = new CallExp(loc, e, args);
265 fdptr.fbody = new ReturnStatement(loc, e); 265 fdptr.fbody = new ReturnStatement(loc, e);
266 ScopeDsymbol ss = fdx.parent.isScopeDsymbol(); 266 ScopeDsymbol ss = fdx.parent.isScopeDsymbol();
267 assert(ss); 267 assert(ss);
268 ss.members.push(cast(void*)fdptr); 268 ss.members.push(cast(void*)fdptr);
269 fdptr.addMember(sc, ss, 1); 269 fdptr.addMember(sc, ss, true);
270 fdptr.semantic(sc2); 270 fdptr.semantic(sc2);
271 } 271 }
272 } 272 }
273 } 273 }
274 274
515 Statement s2 = new ReturnStatement(Loc(0), e); 515 Statement s2 = new ReturnStatement(Loc(0), e);
516 516
517 fop.fbody = new CompoundStatement(Loc(0), s1, s2); 517 fop.fbody = new CompoundStatement(Loc(0), s1, s2);
518 518
519 members.push(cast(void*)fop); 519 members.push(cast(void*)fop);
520 fop.addMember(sc, this, 1); 520 fop.addMember(sc, this, true);
521 521
522 sc = sc.push(); 522 sc = sc.push();
523 sc.stc = STC.STCundefined; 523 sc.stc = STC.STCundefined;
524 sc.linkage = LINK.LINKd; 524 sc.linkage = LINK.LINKd;
525 525