patterns: Restore data offset for local variables / added array, nested structs and functions tests (#475)

* fix(eval): restore data offset for local variables

* test(pattern_lang): add tests for arrays, nested structs and functions

Co-authored-by: Dmitry Polshakov <dmitry.polshakov@dsr-corporation.com>
This commit is contained in:
Polshakov Dmitry
2022-03-20 23:42:21 +03:00
committed by GitHub
parent bc7c494316
commit 937ccbc5bd
5 changed files with 153 additions and 3 deletions

View File

@@ -37,12 +37,13 @@ namespace hex::pl {
auto startOffset = this->dataOffset();
std::unique_ptr<Pattern> pattern;
this->dataOffset() = startOffset;
bool referenceType = false;
auto typePattern = type->createPatterns(this);
this->dataOffset() = startOffset;
if (typePattern.empty()) {
// Handle auto variables
if (!value.has_value())