Support getting line for diagnostic
This commit is contained in:
@@ -10,9 +10,7 @@
|
||||
#include "Binder/Binder.hpp"
|
||||
|
||||
Porygon::Script* Porygon::Script::Create(const u16string& script) {
|
||||
auto s = new Script();
|
||||
s -> Parse(script);
|
||||
return s;
|
||||
return new Script(script);
|
||||
}
|
||||
|
||||
std::u16string To_UTF16(const string &s)
|
||||
@@ -24,11 +22,13 @@ Porygon::Script *Porygon::Script::Create(const string &script) {
|
||||
return Script::Create(To_UTF16(script));
|
||||
}
|
||||
|
||||
Porygon::Script::Script() {
|
||||
Diagnostics = new Diagnostics::DiagnosticsHolder();
|
||||
Porygon::Script::Script(const u16string& s) {
|
||||
Diagnostics = new Diagnostics::DiagnosticsHolder(s);
|
||||
_boundScript = nullptr;
|
||||
_scriptVariables = new unordered_map<uint32_t, shared_ptr<EvalValue>>(0);
|
||||
_evaluator = new Evaluator(this -> _scriptVariables);
|
||||
|
||||
this -> Parse(s);
|
||||
}
|
||||
|
||||
EvalValue* Porygon::Script::Evaluate() {
|
||||
|
||||
Reference in New Issue
Block a user