Mercurial > projects > dang
diff sema/AstAction.d @ 78:ad956143dcdc new_gen
Parse and gen for dereferences
author | Anders Halager <halager@gmail.com> |
---|---|
date | Fri, 02 May 2008 16:38:31 +0200 |
parents | 381975d76baf |
children | 81813366ef92 |
line wrap: on
line diff
--- a/sema/AstAction.d Fri May 02 15:48:57 2008 +0200 +++ b/sema/AstAction.d Fri May 02 16:38:31 2008 +0200 @@ -128,8 +128,11 @@ override ExprT actOnUnaryOp(Token op, ExprT operand) { Exp target = cast(Exp)operand; - // can only be -x for now - return new NegateExp(target); + if (op.type == Tok.Minus) + return new NegateExp(target); + if (op.type == Tok.Star) + return new DerefExp(target); + assert(0, "Only valid unary expressions are -x and *x"); } override ExprT actOnCallExpr(ExprT fn, ref Token, ExprT[] args, ref Token)