aboutsummaryrefslogtreecommitdiff
path: root/vm.d
diff options
context:
space:
mode:
Diffstat (limited to 'vm.d')
-rw-r--r--vm.d14
1 files changed, 8 insertions, 6 deletions
diff --git a/vm.d b/vm.d
index 40877b8..c14c746 100644
--- a/vm.d
+++ b/vm.d
@@ -153,7 +153,8 @@ class VM {
bool isString(Value value) {
return value.type == ValueType.STRING ||
- value.type == ValueType.TYPE;
+ value.type == ValueType.TYPE ||
+ value.type == ValueType.SEQ; // WRONG
}
bool isType(Value value) {
@@ -195,6 +196,9 @@ class VM {
string asString(Value value) {
if (value.type == ValueType.TYPE) {
return value.as.type;
+ } else if (value.type == ValueType.SEQ) {
+ String str = cast(String)value.as.seq;
+ return str.str;
} else {
return value.as.str;
}
@@ -443,11 +447,9 @@ class VM {
this.pushA(makeBooleanValue(!bval));
break;
case OpCode.OP_CONCAT:
- Value b = this.popA();
- Value a = this.popA();
- string bstr = asString(b);
- string astr = asString(a);
- this.pushA(makeStringValue(astr ~ bstr));
+ Seq b = asSeq(this.popA());
+ Seq a = asSeq(this.popA());
+ this.pushA(makeSeqValue(a.concat(b)));
break;
case OpCode.OP_GREATER:
Value b = this.popA();