fix: Parent keyword not working at all

This commit is contained in:
WerWolv 2021-06-16 21:13:54 +02:00
parent d7b591f1a2
commit a7092ada08
1 changed files with 3 additions and 3 deletions

View File

@ -46,7 +46,7 @@ namespace hex::lang {
auto parent = currPattern->getParent(); auto parent = currPattern->getParent();
if (parent == nullptr) { if (parent == nullptr) {
this->getConsole().abortEvaluation(hex::format("no parent available for identifier '{0}'", currPattern->getVariableName())); this->getConsole().abortEvaluation("no parent available for identifier");
} else { } else {
currPattern = parent; currPattern = parent;
} }
@ -111,8 +111,8 @@ namespace hex::lang {
PatternData *currPattern = nullptr; PatternData *currPattern = nullptr;
// Local member access // Local member access
if (!this->m_currMembers.empty()) if (this->m_currMembers.size() > 1)
currPattern = this->findPattern(*this->m_currMembers.back(), path); currPattern = this->findPattern(*this->m_currMembers[this->m_currMembers.size() - 2], path);
// If no local member was found, try globally // If no local member was found, try globally
if (currPattern == nullptr) { if (currPattern == nullptr) {