diff --git a/lib/libimhex/include/hex/pattern_language/ast_node.hpp b/lib/libimhex/include/hex/pattern_language/ast_node.hpp index fd090559d..535b0d1d8 100644 --- a/lib/libimhex/include/hex/pattern_language/ast_node.hpp +++ b/lib/libimhex/include/hex/pattern_language/ast_node.hpp @@ -2015,8 +2015,13 @@ namespace hex::pl { for (auto &func : customFunctions) functions.insert(func); - if (!functions.contains(this->m_functionName)) + if (!functions.contains(this->m_functionName)) { + if (this->m_functionName.starts_with("std::")) { + evaluator->getConsole().log(LogConsole::Level::Warning, "This function might be part of the standard library.\nYou can install the standard library though\nthe Content Store found under Help -> Content Store."); + } + LogConsole::abortEvaluation(hex::format("call to unknown function '{}'", this->m_functionName), this); + } auto function = functions[this->m_functionName]; if (function.parameterCount == ContentRegistry::PatternLanguage::UnlimitedParameters) { diff --git a/lib/libimhex/source/pattern_language/preprocessor.cpp b/lib/libimhex/source/pattern_language/preprocessor.cpp index c10e01285..63c6fc418 100644 --- a/lib/libimhex/source/pattern_language/preprocessor.cpp +++ b/lib/libimhex/source/pattern_language/preprocessor.cpp @@ -72,8 +72,12 @@ namespace hex::pl { } File file(includePath, File::Mode::Read); - if (!file.isValid()) - throwPreprocessorError(hex::format("{0}: No such file or directory", includeFile.c_str()), lineNumber); + if (!file.isValid()) { + if (includePath.parent_path().filename().string() == "std") + throwPreprocessorError(hex::format("{0}: No such file or directory.\n\nThis file might be part of the standard library.\nYou can install the standard library though\nthe Content Store found under Help -> Content Store.", includeFile.c_str()), lineNumber); + else + throwPreprocessorError(hex::format("{0}: No such file or directory", includeFile.c_str()), lineNumber); + } bool shouldInclude = true; this->addPragmaHandler("once", [&, includePath, this](const std::string &value) {