1
0
mirror of synced 2024-11-15 11:33:23 +01:00

patterns: Fixed endian pragma not working

This commit is contained in:
WerWolv 2021-10-06 15:19:32 +02:00
parent 7eb4b40dc7
commit 3e30f75e7b
2 changed files with 3 additions and 6 deletions

View File

@ -46,9 +46,6 @@ namespace hex::pl {
std::vector<ASTNode*> m_currAST; std::vector<ASTNode*> m_currAST;
prv::Provider *m_provider = nullptr;
std::endian m_defaultEndian = std::endian::native;
std::optional<std::pair<u32, std::string>> m_currError; std::optional<std::pair<u32, std::string>> m_currError;
}; };

View File

@ -25,13 +25,13 @@ namespace hex::pl {
this->m_preprocessor->addPragmaHandler("endian", [this](std::string value) { this->m_preprocessor->addPragmaHandler("endian", [this](std::string value) {
if (value == "big") { if (value == "big") {
this->m_defaultEndian = std::endian::big; this->m_evaluator->setDefaultEndian(std::endian::big);
return true; return true;
} else if (value == "little") { } else if (value == "little") {
this->m_defaultEndian = std::endian::little; this->m_evaluator->setDefaultEndian(std::endian::little);
return true; return true;
} else if (value == "native") { } else if (value == "native") {
this->m_defaultEndian = std::endian::native; this->m_evaluator->setDefaultEndian(std::endian::native);
return true; return true;
} else } else
return false; return false;