Fix CHKCALL

This commit is contained in:
otya128 committed 2016-12-23 20:19:42 +09:00
1 parent 9df64ca072
commit 53e7138bd7
2 files changed
+12 -1

No files matched your search

+11
View File
@@ -297,6 +297,17 @@ class VM
{ {
return backTraceStack[0..traceI]; return backTraceStack[0..traceI];
} }
bool chkcall(wstring func)
{
import otya.smilebasic.builtinfunctions;
if (func in currentSlot.functions)
return true;
if (func in BuiltinFunction.builtinFunctions)
return true;
if (func in commonFunctions)
return true;
return false;
}
} }
enum CodeType enum CodeType
{ {
+1 -1
View File
@@ -2246,7 +2246,7 @@ class BuiltinFunction
static int CHKCALL(PetitComputer p, wstring func) static int CHKCALL(PetitComputer p, wstring func)
{ {
func = func.toUpper; func = func.toUpper;
return (func in p.vm.currentSlot.functions) != null || (func in otya.smilebasic.builtinfunctions.BuiltinFunction.builtinFunctions) != null; return p.vm.chkcall(func);
} }
static int CHKLABEL(PetitComputer p, wstring label) static int CHKLABEL(PetitComputer p, wstring label)
{ {