comparison dmd/ForeachStatement.d @ 72:2e2a5c3f943a

reduced warnings by adding override to the methods think this also normalizes different line endings used all over the place
author Trass3r
date Sat, 28 Aug 2010 16:19:48 +0200
parents efb1e5bdf63c
children ef02e2e203c2
comparison
equal deleted inserted replaced
71:8e24ef1dd139 72:2e2a5c3f943a
96 96
97 gotos = new Array(); 97 gotos = new Array();
98 cases = new Array(); 98 cases = new Array();
99 } 99 }
100 100
101 Statement syntaxCopy() 101 override Statement syntaxCopy()
102 { 102 {
103 Arguments args = Argument.arraySyntaxCopy(arguments); 103 Arguments args = Argument.arraySyntaxCopy(arguments);
104 Expression exp = aggr.syntaxCopy(); 104 Expression exp = aggr.syntaxCopy();
105 ForeachStatement s = new ForeachStatement(loc, op, args, exp, 105 ForeachStatement s = new ForeachStatement(loc, op, args, exp,
106 body_ ? body_.syntaxCopy() : null); 106 body_ ? body_.syntaxCopy() : null);
107 return s; 107 return s;
108 } 108 }
109 109
110 Statement semantic(Scope sc) 110 override Statement semantic(Scope sc)
111 { 111 {
112 //printf("ForeachStatement.semantic() %p\n", this); 112 //printf("ForeachStatement.semantic() %p\n", this);
113 ScopeDsymbol sym; 113 ScopeDsymbol sym;
114 Statement s = this; 114 Statement s = this;
115 size_t dim = arguments.dim; 115 size_t dim = arguments.dim;
779 } 779 }
780 } 780 }
781 return result; 781 return result;
782 } 782 }
783 783
784 bool hasBreak() 784 override bool hasBreak()
785 { 785 {
786 return true; 786 return true;
787 } 787 }
788 788
789 bool hasContinue() 789 override bool hasContinue()
790 { 790 {
791 return true; 791 return true;
792 } 792 }
793 793
794 bool usesEH() 794 override bool usesEH()
795 { 795 {
796 return body_.usesEH(); 796 return body_.usesEH();
797 } 797 }
798 798
799 BE blockExit() 799 override BE blockExit()
800 { 800 {
801 BE result = BEfallthru; 801 BE result = BEfallthru;
802 802
803 if (aggr.canThrow()) 803 if (aggr.canThrow())
804 result |= BEthrow; 804 result |= BEthrow;
808 result |= body_.blockExit() & ~(BEbreak | BEcontinue); 808 result |= body_.blockExit() & ~(BEbreak | BEcontinue);
809 } 809 }
810 return result; 810 return result;
811 } 811 }
812 812
813 bool comeFrom() 813 override bool comeFrom()
814 { 814 {
815 if (body_) 815 if (body_)
816 return body_.comeFrom(); 816 return body_.comeFrom();
817 817
818 return false; 818 return false;
819 } 819 }
820 820
821 Expression interpret(InterState istate) 821 override Expression interpret(InterState istate)
822 { 822 {
823 assert(false); 823 assert(false);
824 } 824 }
825 825
826 void toCBuffer(OutBuffer buf, HdrGenState* hgs) 826 override void toCBuffer(OutBuffer buf, HdrGenState* hgs)
827 { 827 {
828 buf.writestring(Token.toChars(op)); 828 buf.writestring(Token.toChars(op));
829 buf.writestring(" ("); 829 buf.writestring(" (");
830 for (int i = 0; i < arguments.dim; i++) 830 for (int i = 0; i < arguments.dim; i++)
831 { 831 {
849 body_.toCBuffer(buf, hgs); 849 body_.toCBuffer(buf, hgs);
850 buf.writebyte('}'); 850 buf.writebyte('}');
851 buf.writenl(); 851 buf.writenl();
852 } 852 }
853 853
854 Statement inlineScan(InlineScanState* iss) 854 override Statement inlineScan(InlineScanState* iss)
855 { 855 {
856 aggr = aggr.inlineScan(iss); 856 aggr = aggr.inlineScan(iss);
857 if (body_) 857 if (body_)
858 body_ = body_.inlineScan(iss); 858 body_ = body_.inlineScan(iss);
859 return this; 859 return this;
860 } 860 }
861 861
862 void toIR(IRState* irs) 862 override void toIR(IRState* irs)
863 { 863 {
864 assert(false); 864 assert(false);
865 } 865 }
866 } 866 }