Mercurial > projects > dang
diff ast/Exp.d @ 7:2ce5209f1954
Starting to work on bool support, for now == works
author | Anders Halager <halager@gmail.com> |
---|---|
date | Fri, 18 Apr 2008 12:50:54 +0200 |
parents | 2168f4cb73f1 |
children | 2f493057cf17 |
line wrap: on
line diff
--- a/ast/Exp.d Fri Apr 18 12:24:14 2008 +0200 +++ b/ast/Exp.d Fri Apr 18 12:50:54 2008 +0200 @@ -55,10 +55,11 @@ class BinaryExp : Exp { - public enum Operator : char + public enum Operator { - Mul = '*', Div = '/', - Add = '+', Sub = '-' + Eq, Ne, + Mul, Div, + Add, Sub, } this(Operator op, Exp left, Exp right) @@ -69,6 +70,13 @@ this.right = right; } + char[] resultType() + { + if (op >= Operator.Eq && op <= Operator.Ne) + return "bool"; + return null; + } + Operator op; Exp left, right; }