From 7e2fe1992db7e6ffb441e27ea6e6b59bc968c965 Mon Sep 17 00:00:00 2001 From: otya128 Date: Tue, 4 Jul 2017 18:42:32 +0900 Subject: [PATCH] Fix variable definition from direct mode --- SMILEBASIC/compiler.d | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SMILEBASIC/compiler.d b/SMILEBASIC/compiler.d index 7b84b29..cff7358 100644 --- a/SMILEBASIC/compiler.d +++ b/SMILEBASIC/compiler.d @@ -331,7 +331,7 @@ class Compiler code ~= new PushG(global); return; } - if(sc.func) + if(sc.func && !isDirectMode) { code ~= new PushL(sc.func.getLocalVarIndex(name, this)); return; @@ -359,7 +359,7 @@ class Compiler code ~= new PushGRef(global); return; } - if(sc.func) + if(sc.func && !isDirectMode) { code ~= new PushLRef(sc.func.getLocalVarIndex(name, this)); return; @@ -388,7 +388,7 @@ class Compiler code ~= new PopG(global); return; } - if(sc.func) + if(sc.func && !isDirectMode) { code ~= new PopL(sc.func.getLocalVarIndex(name, this)); return; @@ -464,7 +464,7 @@ class Compiler } int defineVarIndex(wstring name, Scope sc) { - if(sc.func) + if(sc.func && !isDirectMode) { return sc.func.defineLocalVarIndex(name, this); } @@ -472,7 +472,7 @@ class Compiler } int defineVarIndexVoid(wstring name, Scope sc) { - if(sc.func) + if(sc.func && !isDirectMode) { return sc.func.defineLocalVarIndexVoid(name, this); }