Mercurial > projects > dang
diff sema/Visitor.d @ 176:dc9bf56b7ace
Can now use & as a unary operator and take an AddressOf
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Thu, 24 Jul 2008 23:03:18 +0200 |
parents | 01c2c49775ef |
children | 7b274cfdc1dc |
line wrap: on
line diff
--- a/sema/Visitor.d Thu Jul 24 21:12:12 2008 +0200 +++ b/sema/Visitor.d Thu Jul 24 23:03:18 2008 +0200 @@ -91,6 +91,8 @@ return visitNegateExp(cast(NegateExp)exp); case ExpType.Deref: return visitDerefExp(cast(DerefExp)exp); + case ExpType.AddressOfExp: + return visitAddressOfExp(cast(AddressOfExp)exp); case ExpType.AssignExp: return visitAssignExp(cast(AssignExp)exp); case ExpType.CallExp: @@ -367,6 +369,15 @@ return ExpT.init; } + ExpT visitAddressOfExp(AddressOfExp exp) + { + visitExp(exp.exp); + static if (is(ExpT == void)) + return; + else + return ExpT.init; + } + ExpT visitIntegerLit(IntegerLit exp) { static if (is(ExpT == void))