patterns: Fixed endian pragma not working
This commit is contained in:
parent
7eb4b40dc7
commit
3e30f75e7b
@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user