Mercurial > projects > dang
diff ast/Exp.d @ 107:189c049cbfcc new_gen
Cleanup of codegen, better support for operators a few bugfixes
author | Anders Halager <halager@gmail.com> |
---|---|
date | Sun, 25 May 2008 14:40:14 +0200 |
parents | 7f9240d4ddc1 |
children | d1f68bfb58ae |
line wrap: on
line diff
--- a/ast/Exp.d Thu May 08 10:54:29 2008 +0200 +++ b/ast/Exp.d Sun May 25 14:40:14 2008 +0200 @@ -27,7 +27,7 @@ CastExp, } -class Exp +abstract class Exp { this(ExpType expType, SLoc loc) { @@ -36,7 +36,7 @@ } /// Get the type of the expression - DType type() { return null; } + DType type(); /// Indicates which type the expression is - to avoid a lot of casts ExpType expType; @@ -59,10 +59,8 @@ /// Get the full extents of the expression SourceRange sourceRange() { return SourceRange(loc, loc + 1); } - Exp simplify() - { - return this; - } + /// Do some simplifications + Exp simplify() { return this; } } class CallExp : Exp @@ -284,7 +282,7 @@ } override DType type() - { + { return exp.type().asPointer.pointerOf; }