mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
pattern: Fixed pragma once memory corruption
This commit is contained in:
@@ -22,10 +22,15 @@ namespace hex::pl {
|
||||
std::optional<std::string> preprocess(const std::string &code, bool initialRun = true);
|
||||
|
||||
void addPragmaHandler(const std::string &pragmaType, const std::function<bool(const std::string &)> &function);
|
||||
void removePragmaHandler(const std::string &pragmaType);
|
||||
void addDefaultPragmaHandlers();
|
||||
|
||||
const std::optional<PatternLanguageError> &getError() { return this->m_error; }
|
||||
|
||||
bool shouldOnlyIncludeOnce() {
|
||||
return this->m_onlyIncludeOnce;
|
||||
}
|
||||
|
||||
private:
|
||||
[[noreturn]] static void throwPreprocessorError(const std::string &error, u32 lineNumber) {
|
||||
throw PatternLanguageError(lineNumber, "Preprocessor: " + error);
|
||||
@@ -39,6 +44,8 @@ namespace hex::pl {
|
||||
std::set<fs::path> m_onceIncludedFiles;
|
||||
|
||||
std::optional<PatternLanguageError> m_error;
|
||||
|
||||
bool m_onlyIncludeOnce = false;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user