Implement CHKLABEL(label,global)
This commit is contained in:
1 parent
2d2c09e38b
commit
be5424a203
2 files changed
+11
-5
No files matched your search
+8
-3
@@ -438,7 +438,7 @@ class VM
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
bool chklabel(wstring label)
|
||||
bool chklabel(wstring label, bool global)
|
||||
{
|
||||
auto name = parse(label);
|
||||
VMSlot slot;
|
||||
@@ -454,10 +454,15 @@ class VM
|
||||
{
|
||||
slot = currentSlot;
|
||||
}
|
||||
if (currentFunction)
|
||||
{
|
||||
if (name.name in currentFunction.label)
|
||||
return true;
|
||||
if (!global)
|
||||
return false;
|
||||
}
|
||||
if (name.name in slot.globalLabel)
|
||||
return true;
|
||||
if (currentFunction && name.name in currentFunction.label)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
bool chkvar(wstring var)
|
||||
|
||||
Reference in new issue
Block a user