diff --git a/libskrypt/skrypt.cpp b/libskrypt/skrypt.cpp index 10e83f0..40e18f4 100644 --- a/libskrypt/skrypt.cpp +++ b/libskrypt/skrypt.cpp @@ -11,8 +11,8 @@ #include #include -#include #include +#include #include @@ -365,7 +365,7 @@ Skrypt::Skrypt(std::istream & stream) } boost::filesystem::path Skrypt::FindModulePath(std::string_view name) const { - auto path = sourceFilePath.parent_path() / name; + auto path = sourceFilePath.parent_path() / name; if (!path.has_extension()) path.replace_extension(".skrypt"); if (!boost::filesystem::exists(path)) { @@ -406,16 +406,16 @@ boost::filesystem::path Skrypt::FindModulePath(std::string_view name) const { Skrypt::module_t Skrypt::GetLoadedModule(std::string_view fileName) const { module_t loaded; - std::shared_lock lock(modulesMapMutex); - auto it = modules.find(fileName); - if (it != modules.end()) { - loaded = it->second; - } - return loaded; + std::shared_lock lock(modulesMapMutex); + auto it = modules.find(fileName); + if (it != modules.end()) { + loaded = it->second; + } + return loaded; } bool Skrypt::IsModuleLoading(std::string_view name) const { - std::shared_lock lock(modulesLoadingMutex); + std::shared_lock lock(modulesLoadingMutex); return modulesLoading.contains(name); } @@ -473,7 +473,7 @@ Skrypt::module_t Skrypt::Module(std::string_view name) { WaitTillModuleLoadingComplete(name); } } - return module; + return module; } Skrypt::loading_module_t Skrypt::StartLoadingModule(std::string_view moduleName) { @@ -539,9 +539,9 @@ void Skrypt::BackgroudLoadingModules(const ::omnn::math::Valuable& v) { } std::string_view Skrypt::GetVariableName(const ::omnn::math::Variable& v) const { - auto host = v.getVaHost(); - auto name = host->GetName(v.getId()); - return name; + auto host = v.getVaHost(); + auto name = host->GetName(v.getId()); + return name; } std::string_view Skrypt::GetModuleName(std::string_view name) const { diff --git a/modules/physics/relativity.skrypt b/modules/physics/relativity.skrypt new file mode 100644 index 0000000..5d66eda --- /dev/null +++ b/modules/physics/relativity.skrypt @@ -0,0 +1,2 @@ + +E=m*(c^2)