comparison dmd/IfStatement.d @ 130:60bb0fe4563e

dmdfe 2.037 first main iteration
author Eldar Insafutdinov <e.insafutdinov@gmail.com>
date Thu, 09 Sep 2010 22:51:44 +0100
parents e28b18c23469
children 14feb7ae01a6
comparison
equal deleted inserted replaced
129:010eb8f0e18d 130:60bb0fe4563e
1 module dmd.IfStatement; 1 module dmd.IfStatement;
2 2
3 import dmd.common; 3 import dmd.common;
4 import dmd.Statement; 4 import dmd.Statement;
5 import dmd.Argument; 5 import dmd.Parameter;
6 import dmd.Loc; 6 import dmd.Loc;
7 import dmd.Expression; 7 import dmd.Expression;
8 import dmd.VarDeclaration; 8 import dmd.VarDeclaration;
9 import dmd.Scope; 9 import dmd.Scope;
10 import dmd.InterState; 10 import dmd.InterState;
30 import dmd.backend.Blockx; 30 import dmd.backend.Blockx;
31 import dmd.backend.BC; 31 import dmd.backend.BC;
32 32
33 class IfStatement : Statement 33 class IfStatement : Statement
34 { 34 {
35 Argument arg; 35 Parameter arg;
36 Expression condition; 36 Expression condition;
37 Statement ifbody; 37 Statement ifbody;
38 Statement elsebody; 38 Statement elsebody;
39 39
40 VarDeclaration match; // for MatchExpression results 40 VarDeclaration match; // for MatchExpression results
41 41
42 this(Loc loc, Argument arg, Expression condition, Statement ifbody, Statement elsebody) 42 this(Loc loc, Parameter arg, Expression condition, Statement ifbody, Statement elsebody)
43 { 43 {
44 super(loc); 44 super(loc);
45 this.arg = arg; 45 this.arg = arg;
46 this.condition = condition; 46 this.condition = condition;
47 this.ifbody = ifbody; 47 this.ifbody = ifbody;
56 56
57 Statement e = null; 57 Statement e = null;
58 if (elsebody) 58 if (elsebody)
59 e = elsebody.syntaxCopy(); 59 e = elsebody.syntaxCopy();
60 60
61 Argument a = arg ? arg.syntaxCopy() : null; 61 Parameter a = arg ? arg.syntaxCopy() : null;
62 IfStatement s = new IfStatement(loc, a, condition.syntaxCopy(), i, e); 62 IfStatement s = new IfStatement(loc, a, condition.syntaxCopy(), i, e);
63 return s; 63 return s;
64 } 64 }
65 65
66 override Statement semantic(Scope sc) 66 override Statement semantic(Scope sc)