Added error messages and error display to pattern language editor

This commit is contained in:
WerWolv
2020-11-27 21:20:23 +01:00
parent d55bea7c46
commit 3827919a32
13 changed files with 329 additions and 138 deletions

View File

@@ -19,13 +19,17 @@ namespace hex::lang {
std::pair<Result, std::string> preprocess(const std::string& code, bool initialRun = true);
void addPragmaHandler(std::string pragmaType, std::function<bool(std::string)> function);
void addDefaultPragramHandlers();
void addDefaultPragmaHandlers();
const std::pair<u32, std::string>& getError() { return this->m_error; }
private:
std::unordered_map<std::string, std::function<bool(std::string)>> m_pragmaHandlers;
std::set<std::pair<std::string, std::string>> m_defines;
std::set<std::pair<std::string, std::string>> m_pragmas;
std::pair<u32, std::string> m_error;
};
}