comparison dmd/Parser.d @ 77:ad4792a1cfd6

more D-ification container accessing
author Eldar Insafutdinov <e.insafutdinov@gmail.com>
date Sun, 29 Aug 2010 14:36:55 +0100
parents 7e0d548de9e6
children 43073c7c7769
comparison
equal deleted inserted replaced
74:7e0d548de9e6 77:ad4792a1cfd6
3216 a = parseDeclarations(STC.STCundefined); 3216 a = parseDeclarations(STC.STCundefined);
3217 if (a.dim > 1) 3217 if (a.dim > 1)
3218 { 3218 {
3219 Statements as = new Statements(); 3219 Statements as = new Statements();
3220 as.reserve(a.dim); 3220 as.reserve(a.dim);
3221 for (int i = 0; i < a.dim; i++) 3221 foreach(Dsymbol d; a)
3222 { 3222 {
3223 Dsymbol d = cast(Dsymbol)a.data[i];
3224 s = new DeclarationStatement(loc, d); 3223 s = new DeclarationStatement(loc, d);
3225 as.push(cast(void*)s); 3224 as.push(cast(void*)s);
3226 } 3225 }
3227 s = new CompoundDeclarationStatement(loc, as); 3226 s = new CompoundDeclarationStatement(loc, as);
3228 } 3227 }
3229 else if (a.dim == 1) 3228 else if (a.dim == 1)
3230 { 3229 {
3231 Dsymbol d = cast(Dsymbol)a.data[0]; 3230 auto d = a[0];
3232 s = new DeclarationStatement(loc, d); 3231 s = new DeclarationStatement(loc, d);
3233 } 3232 }
3234 else 3233 else
3235 assert(0); 3234 assert(0);
3236 if (flags & ParseStatementFlags.PSscope) 3235 if (flags & ParseStatementFlags.PSscope)