SPANIMをループや非線形補完に対応,関数内でグローバル変数が使えなかったバグを修正
This commit is contained in:
@@ -200,11 +200,6 @@ class Compiler
|
||||
void genCodePushVar(wstring name, Scope sc)
|
||||
{
|
||||
auto global = hasGlobalVarIndex(name);
|
||||
if(sc.func)
|
||||
{
|
||||
code ~= new PushL(sc.func.getLocalVarIndex(name, this));
|
||||
return;
|
||||
}
|
||||
if(global)
|
||||
{
|
||||
if(global < 0)
|
||||
@@ -215,16 +210,16 @@ class Compiler
|
||||
code ~= new PushG(global);
|
||||
return;
|
||||
}
|
||||
if(sc.func)
|
||||
{
|
||||
code ~= new PushL(sc.func.getLocalVarIndex(name, this));
|
||||
return;
|
||||
}
|
||||
code ~= new PushG(getGlobalVarIndex(name));
|
||||
}
|
||||
void genCodePopVar(wstring name, Scope sc)
|
||||
{
|
||||
auto global = hasGlobalVarIndex(name);
|
||||
if(sc.func)
|
||||
{
|
||||
code ~= new PopL(sc.func.getLocalVarIndex(name, this));
|
||||
return;
|
||||
}
|
||||
if(global)
|
||||
{
|
||||
if(global < 0)
|
||||
@@ -235,6 +230,11 @@ class Compiler
|
||||
code ~= new PopG(global);
|
||||
return;
|
||||
}
|
||||
if(sc.func)
|
||||
{
|
||||
code ~= new PopL(sc.func.getLocalVarIndex(name, this));
|
||||
return;
|
||||
}
|
||||
code ~= new PopG(getGlobalVarIndex(name));
|
||||
}
|
||||
void getVarIndex(wstring name, Scope sc, out int index, out bool isLocal)
|
||||
|
||||
Reference in New Issue
Block a user