diff dmd/Parser.d @ 126:1765f3ef917d

ClassDeclarations, Arguments -> Vector
author Eldar Insafutdinov <e.insafutdinov@gmail.com>
date Fri, 03 Sep 2010 23:25:55 +0100
parents 767a01c2a272
children e6e542f37b94
line wrap: on
line diff
--- a/dmd/Parser.d	Fri Sep 03 22:17:54 2010 +0100
+++ b/dmd/Parser.d	Fri Sep 03 23:25:55 2010 +0100
@@ -1222,9 +1222,8 @@
 							 * a deduced type.
 							 */
 							TemplateParameters tpl = null;
-							for (int i = 0; i < tf.parameters.dim; i++)
+							foreach (param; tf.parameters)
 							{   
-								Argument param = cast(Argument)tf.parameters.data[i];
 								if (param.ident is null &&
 									param.type &&
 									param.type.ty == Tident &&
@@ -1234,7 +1233,7 @@
 									/* Switch parameter type to parameter identifier,
 									 * parameterize with template type parameter _T
 									 */
-									TypeIdentifier pt = cast(TypeIdentifier)param.type;
+									auto pt = cast(TypeIdentifier)param.type;
 									param.ident = pt.ident;
 									Identifier id = Lexer.uniqueId("__T");
 									param.type = new TypeIdentifier(pt.loc, id);
@@ -1882,13 +1881,13 @@
 					error("variadic argument cannot be out or ref");
 				varargs = 2;
 				a = new Argument(storageClass, at, ai, ae);
-				arguments.push(cast(void*)a);
+				arguments.push(a);
 				nextToken();
 				break;
 				}
 			L3:
 				a = new Argument(storageClass, at, ai, ae);
-				arguments.push(cast(void*)a);
+				arguments.push(a);
 				if (token.value == TOK.TOKcomma)
 				{   nextToken();
 				goto L1;
@@ -3469,7 +3468,7 @@
 				error("no identifier for declarator %s", at.toChars());
 			  Larg:
 			a = new Argument(storageClass, at, ai, null);
-			arguments.push(cast(void*)a);
+			arguments.push(a);
 			if (token.value == TOK.TOKcomma)
 			{   nextToken();
 				continue;
@@ -3481,7 +3480,7 @@
 			aggr = parseExpression();
 			if (token.value == TOK.TOKslice && arguments.dim == 1)
 			{
-			Argument a = cast(Argument)arguments.data[0];
+			auto a = arguments[0];
 			delete arguments;
 			nextToken();
 			Expression upr = parseExpression();