From f1ee1d1d6d82f8342868655bafa5b5da7718c69e Mon Sep 17 00:00:00 2001 From: otya128 Date: Wed, 31 Aug 2016 23:19:30 +0900 Subject: [PATCH] =?UTF-8?q?=E3=81=84=E3=82=89=E3=81=AA=E3=81=84=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SMILEBASIC/VM.d | 84 ------------------------------------------------- 1 file changed, 84 deletions(-) diff --git a/SMILEBASIC/VM.d b/SMILEBASIC/VM.d index 4407ffa..052f97f 100644 --- a/SMILEBASIC/VM.d +++ b/SMILEBASIC/VM.d @@ -1375,90 +1375,6 @@ class CallBuiltinFunction : Code return "callbuiltin " ~ func.name.to!string; } } -class IncCodeG : Code -{ - int var; - this(int var) - { - this.var = var; - } - //TODO:文字列INCの挙動 - override void execute(VM vm) - { - Value v; - Value g = vm.currentSlot.global[var]; - vm.pop(v); - if(!g.isNumber() && g.type != ValueType.String) - { - throw new TypeMismatch(); - } - if((!g.isNumber() || !v.isNumber()) && g.type != v.type) - { - throw new TypeMismatch(); - } - if(g.isNumber()) - { - double l = g.castDouble; - double r = v.castDouble; - if(v.type == ValueType.Double) - vm.currentSlot.global[var] = Value(l + r); - else - vm.currentSlot.global[var] = Value(cast(int)(l + r)); - } - else - { - wstring l = g.stringValue; - wstring r = v.stringValue; - vm.currentSlot.global[var] = Value(l ~ r); - } - } - override string toString(VM vm) - { - return "incglobal " ~ var.to!string; - } -} -class IncCodeL : Code -{ - int var; - this(int var) - { - this.var = var; - } - //TODO:文字列INCの挙動 - override void execute(VM vm) - { - Value v; - Value* g = &vm.stack[vm.bp + var]; - vm.pop(v); - if(!g.isNumber() && g.type != ValueType.String) - { - throw new TypeMismatch(); - } - if((!g.isNumber() || !v.isNumber()) && g.type != v.type) - { - throw new TypeMismatch(); - } - if(g.isNumber()) - { - double l = g.castDouble; - double r = v.castDouble; - if(v.type == ValueType.Double) - *g = Value(l + r); - else - *g = Value(cast(int)(l + r)); - } - else - { - wstring l = g.stringValue; - wstring r = v.stringValue; - *g = Value(l ~ r); - } - } - override string toString(VM vm) - { - return "inclocal " ~ var.to!string; - } -} class OnBase : Code { int[] labels;