Mercurial > projects > ddmd
comparison dmd/ForeachStatement.d @ 66:efb1e5bdf63c
more implementations
author | korDen |
---|---|
date | Mon, 23 Aug 2010 20:38:30 +0400 |
parents | cab4c37afb89 |
children | 2e2a5c3f943a |
comparison
equal
deleted
inserted
replaced
65:9ce5d450c318 | 66:efb1e5bdf63c |
---|---|
1 module dmd.ForeachStatement; | 1 module dmd.ForeachStatement; |
2 | 2 |
3 import dmd.Statement; | 3 import dmd.Statement; |
4 import dmd.TOK; | 4 import dmd.TOK; |
5 import dmd.Token; | |
5 import dmd.Loc; | 6 import dmd.Loc; |
6 import dmd.LINK; | 7 import dmd.LINK; |
7 import dmd.ArrayTypes; | 8 import dmd.ArrayTypes; |
8 import dmd.Expression; | 9 import dmd.Expression; |
9 import dmd.VarDeclaration; | 10 import dmd.VarDeclaration; |
780 return result; | 781 return result; |
781 } | 782 } |
782 | 783 |
783 bool hasBreak() | 784 bool hasBreak() |
784 { | 785 { |
786 return true; | |
787 } | |
788 | |
789 bool hasContinue() | |
790 { | |
791 return true; | |
792 } | |
793 | |
794 bool usesEH() | |
795 { | |
796 return body_.usesEH(); | |
797 } | |
798 | |
799 BE blockExit() | |
800 { | |
801 BE result = BEfallthru; | |
802 | |
803 if (aggr.canThrow()) | |
804 result |= BEthrow; | |
805 | |
806 if (body_) | |
807 { | |
808 result |= body_.blockExit() & ~(BEbreak | BEcontinue); | |
809 } | |
810 return result; | |
811 } | |
812 | |
813 bool comeFrom() | |
814 { | |
815 if (body_) | |
816 return body_.comeFrom(); | |
817 | |
818 return false; | |
819 } | |
820 | |
821 Expression interpret(InterState istate) | |
822 { | |
785 assert(false); | 823 assert(false); |
786 } | 824 } |
787 | 825 |
788 bool hasContinue() | 826 void toCBuffer(OutBuffer buf, HdrGenState* hgs) |
789 { | 827 { |
790 assert(false); | 828 buf.writestring(Token.toChars(op)); |
791 } | 829 buf.writestring(" ("); |
792 | 830 for (int i = 0; i < arguments.dim; i++) |
793 bool usesEH() | 831 { |
794 { | 832 Argument a = cast(Argument)arguments.data[i]; |
795 assert(false); | 833 if (i) |
796 } | 834 buf.writestring(", "); |
797 | 835 if (a.storageClass & STCref) |
798 BE blockExit() | 836 buf.writestring((global.params.Dversion == 1) ? "inout " : "ref "); |
799 { | 837 if (a.type) |
800 assert(false); | 838 a.type.toCBuffer(buf, a.ident, hgs); |
801 } | 839 else |
802 | 840 buf.writestring(a.ident.toChars()); |
803 bool comeFrom() | 841 } |
804 { | 842 buf.writestring("; "); |
805 assert(false); | 843 aggr.toCBuffer(buf, hgs); |
806 } | 844 buf.writebyte(')'); |
807 | 845 buf.writenl(); |
808 Expression interpret(InterState istate) | 846 buf.writebyte('{'); |
809 { | 847 buf.writenl(); |
810 assert(false); | 848 if (body_) |
811 } | 849 body_.toCBuffer(buf, hgs); |
812 | 850 buf.writebyte('}'); |
813 void toCBuffer(OutBuffer uf, HdrGenState* hgs) | 851 buf.writenl(); |
814 { | |
815 assert(false); | |
816 } | 852 } |
817 | 853 |
818 Statement inlineScan(InlineScanState* iss) | 854 Statement inlineScan(InlineScanState* iss) |
819 { | 855 { |
820 aggr = aggr.inlineScan(iss); | 856 aggr = aggr.inlineScan(iss); |