Mercurial > projects > ddmd
comparison dmd/TemplateInstance.d @ 94:3a0b150c9841
Objects -> Vector!Object iteration 1
author | Eldar Insafutdinov <e.insafutdinov@gmail.com> |
---|---|
date | Mon, 30 Aug 2010 23:00:34 +0100 |
parents | 21a53563c840 |
children | 12c0c84d13fd |
comparison
equal
deleted
inserted
replaced
93:df6d0f967680 | 94:3a0b150c9841 |
---|---|
234 if (objs) | 234 if (objs) |
235 { a = new Objects(); | 235 { a = new Objects(); |
236 a.setDim(objs.dim); | 236 a.setDim(objs.dim); |
237 for (size_t i = 0; i < objs.dim; i++) | 237 for (size_t i = 0; i < objs.dim; i++) |
238 { | 238 { |
239 a.data[i] = cast(void*)objectSyntaxCopy(cast(Object)objs.data[i]); | 239 a[i] = objectSyntaxCopy(objs[i]); |
240 } | 240 } |
241 } | 241 } |
242 return a; | 242 return a; |
243 } | 243 } |
244 | 244 |
845 * const substitution in TemplateValueParameter.matchArg(). | 845 * const substitution in TemplateValueParameter.matchArg(). |
846 */ | 846 */ |
847 if (ea.op != TOKvar || flags & 1) | 847 if (ea.op != TOKvar || flags & 1) |
848 ea = ea.optimize(WANTvalue | WANTinterpret); | 848 ea = ea.optimize(WANTvalue | WANTinterpret); |
849 | 849 |
850 tiargs.data[j] = cast(void*)ea; | 850 tiargs[j] = ea; |
851 } | 851 } |
852 else if (sa) | 852 else if (sa) |
853 { | 853 { |
854 tiargs.data[j] = cast(void*)sa; | 854 tiargs[j] = sa; |
855 TupleDeclaration d = sa.toAlias().isTupleDeclaration(); | 855 TupleDeclaration d = sa.toAlias().isTupleDeclaration(); |
856 if (d) | 856 if (d) |
857 { | 857 { |
858 size_t dim = d.objects.dim; | 858 size_t dim = d.objects.dim; |
859 tiargs.remove(j); | 859 tiargs.remove(j); |
873 if (dim) | 873 if (dim) |
874 { | 874 { |
875 tiargs.reserve(dim); | 875 tiargs.reserve(dim); |
876 for (size_t i = 0; i < dim; i++) | 876 for (size_t i = 0; i < dim; i++) |
877 { | 877 { |
878 Argument arg = cast(Argument)tt.arguments.data[i]; | 878 auto arg = cast(Argument)tt.arguments.data[i]; |
879 tiargs.insert(j + i, cast(void*)arg.type); | 879 tiargs.insert(j + i, arg.type); |
880 } | 880 } |
881 } | 881 } |
882 j--; | 882 j--; |
883 } | 883 } |
884 else | 884 else |
885 tiargs.data[j] = cast(void*)ta; | 885 tiargs[j] = ta; |
886 } | 886 } |
887 else | 887 else |
888 { | 888 { |
889 assert(global.errors); | 889 assert(global.errors); |
890 tiargs.data[j] = cast(void*)Type.terror; | 890 tiargs[j] = Type.terror; |
891 } | 891 } |
892 } | 892 } |
893 else if (ea) | 893 else if (ea) |
894 { | 894 { |
895 if (!ea) | 895 if (!ea) |
899 } | 899 } |
900 assert(ea); | 900 assert(ea); |
901 ea = ea.semantic(sc); | 901 ea = ea.semantic(sc); |
902 if (ea.op != TOKvar || flags & 1) | 902 if (ea.op != TOKvar || flags & 1) |
903 ea = ea.optimize(WANTvalue | WANTinterpret); | 903 ea = ea.optimize(WANTvalue | WANTinterpret); |
904 tiargs.data[j] = cast(void*)ea; | 904 tiargs[j] = ea; |
905 if (ea.op == TOKtype) | 905 if (ea.op == TOKtype) |
906 { | 906 { |
907 ta = ea.type; | 907 ta = ea.type; |
908 goto Ltype; | 908 goto Ltype; |
909 } | 909 } |
915 tiargs.remove(j); | 915 tiargs.remove(j); |
916 if (dim) | 916 if (dim) |
917 { | 917 { |
918 tiargs.reserve(dim); | 918 tiargs.reserve(dim); |
919 for (size_t i = 0; i < dim; i++) | 919 for (size_t i = 0; i < dim; i++) |
920 tiargs.insert(j + i, cast(void*)te.exps.data[i]); | 920 tiargs.insert(j + i, te.exps[i]); |
921 } | 921 } |
922 j--; | 922 j--; |
923 } | 923 } |
924 } | 924 } |
925 else if (sa) | 925 else if (sa) |