Mercurial > projects > dang
comparison ast/Exp.d @ 192:fda35d57847e
Fixed String parsing, so that they get created with the right type in AST.
Also added so that you can parse options to the test program, that will mirror them to Dang.
Eg.
./tests/run --semantic-only
will pass --semantic-only to Dang on each run.
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Fri, 25 Jul 2008 15:00:54 +0200 |
parents | 7b274cfdc1dc |
children | 658178183018 |
comparison
equal
deleted
inserted
replaced
191:e799db8d9cb0 | 192:fda35d57847e |
---|---|
530 { | 530 { |
531 super(ExpType.StringExp, loc); | 531 super(ExpType.StringExp, loc); |
532 this.str = str; | 532 this.str = str; |
533 } | 533 } |
534 | 534 |
535 override DType type() { return DType.Char.getAsStaticArray(data.length); } | 535 override DType type() |
536 { | |
537 switch (data.type) | |
538 { | |
539 case StringType.Char: | |
540 return DType.Char.getAsStaticArray(data.data.length); | |
541 case StringType.WChar: | |
542 return DType.WChar.getAsStaticArray(data.data.length/2); | |
543 case StringType.DChar: | |
544 return DType.DChar.getAsStaticArray(data.data.length/4); | |
545 } | |
546 } | |
536 | 547 |
537 char[] str; | 548 char[] str; |
538 ubyte[] data; | 549 String data; |
539 } | 550 } |
540 | 551 |
541 class NewExp : Exp | 552 class NewExp : Exp |
542 { | 553 { |
543 this(Identifier newType, Exp[] a_args, Exp[] c_args) | 554 this(Identifier newType, Exp[] a_args, Exp[] c_args) |