upd: tools almost done

This commit is contained in:
2023-11-09 10:59:39 +08:00
parent b737eb8e7d
commit 6d6b1b9a02
5 changed files with 89 additions and 17 deletions

View File

@ -33,4 +33,19 @@ void VariableContainer::WriteVariable(const std::string &name,
return;
}
top[name] = value;
}
void FucntionContainer::AddFunction(const std::string &name,
const FunctionItem &item) {
if (FunctionIndex.find(name) != FunctionIndex.end()) {
throw InterpretException("AddFunction: function already exists");
}
FunctionIndex[name] = item;
}
std::any FucntionContainer::CallFunction(
const std::string &name, const std::vector<ParaArguItemType> &args) {
if (FunctionIndex.find(name) == FunctionIndex.end()) {
throw InterpretException("CallFunction: function not found");
}
// TODO
}