patterns: Update pattern language

This commit is contained in:
WerWolv
2025-12-21 20:52:46 +01:00
parent 33e315709a
commit 018bedb2bd
7 changed files with 8 additions and 8 deletions

View File

@@ -34,7 +34,7 @@ namespace hex::plugin::builtin {
ContentRegistry::PatternLanguage::configureRuntime(runtime, &m_provider);
constexpr static auto DataDescriptionFunction = "get_data_description";
if (runtime.executeFile(m_foundPatterns.front().patternFilePath)) {
if (runtime.executeFile(m_foundPatterns.front().patternFilePath) == 0) {
const auto &evaluator = runtime.getInternals().evaluator;
const auto &functions = evaluator->getCustomFunctions();
if (const auto function = functions.find(DataDescriptionFunction); function != functions.end()) {

View File

@@ -73,7 +73,7 @@ namespace hex::plugin::builtin {
}
ContentRegistry::PatternLanguage::configureRuntime(m_runtime, &m_provider);
if (!m_runtime.executeString(this->m_sourceCode)) {
if (m_runtime.executeString(this->m_sourceCode) != 0) {
ui::ToastError::open("hex.builtin.view.fullscreen.save_editor.error.failed_execution"_lang);
for (const auto &error : m_runtime.getCompileErrors()) {
log::error("Save Editor Error: {}", error.format());