Mercurial > projects > dang
diff sema/DType.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 | 6e6355fb5f0f |
children | dc9bf56b7ace |
line wrap: on
line diff
--- a/sema/DType.d Tue Jul 22 00:34:49 2008 +0200 +++ b/sema/DType.d Tue Jul 22 13:29:20 2008 +0200 @@ -100,6 +100,11 @@ return cast(hash_t)(cast(void*)this); } + char[] toString() + { + return id; + } + char[] name() { return id; } SourceLocation getLoc() { return loc; } int byteSize() { return 0; } @@ -473,7 +478,7 @@ { this(DType arrayOf, int size, DType actual = null) { - super(id, actual); + super(arrayOf.id ~ "[" ~ Integer.toString(size) ~ "]", actual); this.arrayOf = arrayOf; this.size = size; }