Mercurial > projects > dang
diff sema/Visitor.d @ 185:7b274cfdc1dc
Added support for array literals. Codegen is broken, though.
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Fri, 25 Jul 2008 12:18:05 +0200 |
parents | dc9bf56b7ace |
children | 08f68d684047 |
line wrap: on
line diff
--- a/sema/Visitor.d Fri Jul 25 11:04:00 2008 +0200 +++ b/sema/Visitor.d Fri Jul 25 12:18:05 2008 +0200 @@ -117,6 +117,8 @@ return visitMemberReference(cast(MemberReference)exp); case ExpType.NewExp: return visitNewExp(cast(NewExp)exp); + case ExpType.ArrayLiteralExp: + return visitArrayLiteralExp(cast(ArrayLiteralExp)exp); default: throw new Exception("Unknown expression type"); } @@ -472,5 +474,16 @@ else return ExpT.init; } + + ExpT visitArrayLiteralExp(ArrayLiteralExp a) + { + foreach( e ; a.exps ) + visitExp(e); + + static if (is(ExpT == void)) + return; + else + return ExpT.init; + } }