Mercurial > projects > ddmd
diff dmd/Parser.d @ 128:e6e542f37b94
Some more Array -> Vector conversions
author | Eldar Insafutdinov <e.insafutdinov@gmail.com> |
---|---|
date | Sat, 04 Sep 2010 01:33:05 +0100 |
parents | 1765f3ef917d |
children | 60bb0fe4563e |
line wrap: on
line diff
--- a/dmd/Parser.d Fri Sep 03 23:55:51 2010 +0100 +++ b/dmd/Parser.d Sat Sep 04 01:33:05 2010 +0100 @@ -262,13 +262,13 @@ } else { - Array a = null; + Identifiers a = null; Identifier id = token.ident; while (nextToken() == TOK.TOKdot) { if (!a) - a = new Array(); - a.push(cast(void*)id); + a = new Identifiers(); + a.push(id); nextToken(); if (token.value != TOK.TOKidentifier) { error("Identifier expected following package"); @@ -2164,7 +2164,7 @@ Import s; Identifier id; Identifier aliasid = null; - Array a; + Identifiers a; Loc loc; //printf("Parser.parseImport()\n"); @@ -2190,8 +2190,8 @@ while (token.value == TOK.TOKdot) { if (!a) - a = new Array(); - a.push(cast(void*)id); + a = new Identifiers(); + a.push(id); nextToken(); if (token.value != TOK.TOKidentifier) { @@ -3660,14 +3660,14 @@ case TOK.TOKcase: { Expression exp; Statements statements; - scope Array cases = new Array(); // array of Expression's + scope cases = new Expressions(); // array of Expression's Expression last = null; while (1) { nextToken(); exp = parseAssignExp(); - cases.push(cast(void*)exp); + cases.push(exp); if (token.value != TOK.TOKcomma) break; } @@ -3709,7 +3709,7 @@ // Keep cases in order by building the case statements backwards for (int i = cases.dim; i; i--) { - exp = cast(Expression)cases.data[i - 1]; + exp = cases[i - 1]; s = new CaseStatement(loc, exp, s); } }