Skip to content

Commit

Permalink
ext: synced MiniScript
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasdr committed Dec 19, 2023
1 parent 2511d95 commit 3e5b618
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
18 changes: 8 additions & 10 deletions ext/miniscript/src/miniscript/miniscript/Library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,22 @@
using std::make_unique;
using std::string;

using miniscript::miniscript::Library;
using _Context = miniscript::miniscript::Context;
using _Library = miniscript::miniscript::Library;
using _Console = miniscript::utilities::Console;

using miniscript::miniscript::Context;
using miniscript::miniscript::MiniScript;
using miniscript::utilities::Console;

Library::Library(Context* context) {
_Library::Library(_Context* context) {
this->context = context;
}

Library::~Library() {
_Library::~Library() {
}

MiniScript* Library::loadScript(const string& pathName, const string& fileName) {
Console::println("Library::loadScript(): " + pathName + "/" + fileName);
MiniScript* _Library::loadScript(const string& pathName, const string& fileName, const string& basePathName) {
_Console::println("Library::loadScript(): " + pathName + "/" + fileName + (basePathName.empty() == false?"@" + basePathName:""));
auto script = make_unique<MiniScript>();
script->setContext(context);
script->setLibrary(this);
script->parseScript(pathName, fileName);
script->parseScript((basePathName.empty() == false?basePathName + "/":"") + pathName, fileName);
return script.release();
}
3 changes: 2 additions & 1 deletion ext/miniscript/src/miniscript/miniscript/NativeLibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class miniscript::miniscript::NativeLibrary: public _Library
FORBID_CLASS_COPY(NativeLibrary)

/**
* Constructor
* Public constructor
* @param context context or nullptr
*/
NativeLibrary(_Context* context): _Library(context) {
}
Expand Down

0 comments on commit 3e5b618

Please sign in to comment.