comparison dmd/IsExp.d @ 130:60bb0fe4563e

dmdfe 2.037 first main iteration
author Eldar Insafutdinov <e.insafutdinov@gmail.com>
date Thu, 09 Sep 2010 22:51:44 +0100
parents 1765f3ef917d
children af1bebfd96a4
comparison
equal deleted inserted replaced
129:010eb8f0e18d 130:60bb0fe4563e
26 import dmd.TypeDelegate; 26 import dmd.TypeDelegate;
27 import dmd.Declaration; 27 import dmd.Declaration;
28 import dmd.TypeFunction; 28 import dmd.TypeFunction;
29 import dmd.MATCH; 29 import dmd.MATCH;
30 import dmd.TypePointer; 30 import dmd.TypePointer;
31 import dmd.Argument; 31 import dmd.Parameter;
32 import dmd.Token; 32 import dmd.Token;
33 33
34 class IsExp : Expression 34 class IsExp : Expression
35 { 35 {
36 /* is(targ id tok tspec) 36 /* is(targ id tok tspec)
162 // If class or interface, get the base class and interfaces 162 // If class or interface, get the base class and interfaces
163 if (targ.ty != Tclass) 163 if (targ.ty != Tclass)
164 goto Lno; 164 goto Lno;
165 else 165 else
166 { ClassDeclaration cd = (cast(TypeClass)targ).sym; 166 { ClassDeclaration cd = (cast(TypeClass)targ).sym;
167 auto args = new Arguments; 167 auto args = new Parameters;
168 args.reserve(cd.baseclasses.dim); 168 args.reserve(cd.baseclasses.dim);
169 foreach (b; cd.baseclasses) 169 foreach (b; cd.baseclasses)
170 { 170 {
171 args.push(new Argument(STCin, b.type, null, null)); 171 args.push(new Parameter(STCin, b.type, null, null));
172 } 172 }
173 tded = new TypeTuple(args); 173 tded = new TypeTuple(args);
174 } 174 }
175 break; 175 break;
176 176
193 tded = targ; 193 tded = targ;
194 194
195 /* Generate tuple from function parameter types. 195 /* Generate tuple from function parameter types.
196 */ 196 */
197 assert(tded.ty == Tfunction); 197 assert(tded.ty == Tfunction);
198 Arguments params = (cast(TypeFunction)tded).parameters; 198 auto params = (cast(TypeFunction)tded).parameters;
199 size_t dim = Argument.dim(params); 199 size_t dim = Parameter.dim(params);
200 Arguments args = new Arguments; 200 auto args = new Parameters;
201 args.reserve(dim); 201 args.reserve(dim);
202 for (size_t i = 0; i < dim; i++) 202 for (size_t i = 0; i < dim; i++)
203 { 203 {
204 auto arg = Argument.getNth(params, i); 204 auto arg = Parameter.getNth(params, i);
205 assert(arg && arg.type); 205 assert(arg && arg.type);
206 args.push(new Argument(arg.storageClass, arg.type, null, null)); 206 args.push(new Parameter(arg.storageClass, arg.type, null, null));
207 } 207 }
208 tded = new TypeTuple(args); 208 tded = new TypeTuple(args);
209 break; 209 break;
210 } 210 }
211 211