General fixes for ScriptOptions
This commit is contained in:
parent
e913f8d052
commit
df755fcdd3
|
@ -92,6 +92,7 @@ const EvalValue* Porygon::Script::CallFunction(const u16string &key, const vecto
|
||||||
|
|
||||||
Porygon::Script *Porygon::Script::Clone(const Porygon::Script *script) {
|
Porygon::Script *Porygon::Script::Clone(const Porygon::Script *script) {
|
||||||
auto s = new Script(script->_boundScript, script->Diagnostics);
|
auto s = new Script(script->_boundScript, script->Diagnostics);
|
||||||
|
s->_scriptOptions = script ->_scriptOptions;
|
||||||
for (const auto& v: *script->_scriptVariables){
|
for (const auto& v: *script->_scriptVariables){
|
||||||
s->_scriptVariables->insert({v.first, nullptr});
|
s->_scriptVariables->insert({v.first, nullptr});
|
||||||
}
|
}
|
||||||
|
@ -115,8 +116,8 @@ Porygon::Script::Script(shared_ptr<BoundScriptStatement> boundScript,
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
Porygon::Script* CreateScript(char16_t * s){
|
Porygon::Script* CreateScript(char16_t * s, Porygon::ScriptOptions* options){
|
||||||
return Porygon::Script::Create(s);
|
return Porygon::Script::Create(s, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
Porygon::Script* CloneScript(Porygon::Script* p){
|
Porygon::Script* CloneScript(Porygon::Script* p){
|
||||||
|
|
|
@ -52,7 +52,7 @@ extern "C"{
|
||||||
opt->SetModuleExistsFunc(func);
|
opt->SetModuleExistsFunc(func);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetOptionResolveModuleFunc(Porygon::ScriptOptions* opt, bool (*func)(const std::string& moduleName)){
|
void SetOptionResolveModuleFunc(Porygon::ScriptOptions* opt, Porygon::Script* (*func)(const std::string& moduleName)){
|
||||||
opt->SetModuleExistsFunc(func);
|
opt->SetResolveModuleFunc(func);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue