Mercurial > projects > dang
view sema/LiteralInterpreter.d @ 160:6cb2f4201e2a
Improved static arrays
Here is a list of some stuff that works
char[3] s = "hey"
char[3] s2 = s;
s2[1] = 98 // no support for chars, but 98 = 'b' :)
int[2] i;
i[0] = 2;
Still can't pass static arrays to functions
author | Anders Halager <halager@gmail.com> |
---|---|
date | Tue, 22 Jul 2008 13:29:20 +0200 |
parents | c0b531362ca6 |
children | fda35d57847e |
line wrap: on
line source
module sema.LiteralInterpreter; import sema.Visitor; import basic.LiteralParsing, basic.Message; class LiteralInterpreter : Visitor!(void) { this(MessageHandler messages) { this.messages = messages; } void visit(Module[] modules) { super.visit(modules); messages.checkErrors(); } void visitStringExp(StringExp exp) { auto str = parseString(exp.str, exp.loc, messages); exp.data = str.data; } void visitIntegerLit(IntegerLit exp) { exp.number = parseNumber(exp.name, exp.loc, messages); } MessageHandler messages; }