Mercurial > projects > dang
diff ast/Exp.d @ 126:c3b24e7e8cf8
Carius changes to the parser. Parsing attributes, lexing many keywords(not all yet).
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Tue, 27 May 2008 10:32:31 +0200 |
parents | d604152de1eb |
children | ed815b31479b |
line wrap: on
line diff
--- a/ast/Exp.d Sun May 25 21:13:56 2008 +0200 +++ b/ast/Exp.d Tue May 27 10:32:31 2008 +0200 @@ -138,11 +138,11 @@ } } -class AssignExp : Exp +class AssignExp : BinaryExp { - this(SLoc op, Exp identifier, Exp exp) + this(SLoc op_loc, Operator op, Exp identifier, Exp exp) { - super(ExpType.AssignExp, op); + super(ExpType.AssignExp, op_loc, op, identifier, exp); this.identifier = identifier; this.exp = exp; } @@ -171,6 +171,11 @@ public enum Operator { Assign, + AddAssign, + SubAssign, + MulAssign, + DivAssign, + ModAssign, Eq, Ne, @@ -185,7 +190,7 @@ And, Or, Xor, } - char[][] getOp = ["=","==","!=","<","<=",">",">=","+","-","*","/","%","<<",">>",">>>"]; + char[][] getOp = ["=","+=","-=","*=","/=","%=","==","!=","<","<=",">",">=","+","-","*","/","%","<<",">>",">>>"]; this(SLoc op_loc, Operator op, Exp left, Exp right) { @@ -195,6 +200,14 @@ this.right = right; } + protected this(ExpType e, SLoc op_loc, Operator op, Exp left, Exp right) + { + super(e, op_loc); + this.op = op; + this.left = left; + this.right = right; + } + override DType type() { if (myType)