1
0
mirror of synced 2024-11-24 15:50:16 +01:00

fix: Pattern settings resetting at re-evaluation

This commit is contained in:
WerWolv 2024-01-27 10:49:40 +01:00
parent 33637e92b5
commit 6a1a991c08

View File

@ -1053,8 +1053,7 @@ namespace hex::plugin::builtin {
const auto &ast = m_parserRuntime->parseString(code);
auto &patternVariables = m_patternVariables.get(provider);
patternVariables.clear();
auto oldPatternVariables = std::move(patternVariables);
if (ast.has_value()) {
for (auto &node : *ast) {
@ -1070,7 +1069,7 @@ namespace hex::plugin::builtin {
.inVariable = variableDecl->isInVariable(),
.outVariable = variableDecl->isOutVariable(),
.type = builtinType->getType(),
.value = { }
.value = oldPatternVariables.contains(variableDecl->getName()) ? oldPatternVariables[variableDecl->getName()].value : pl::core::Token::Literal()
};
if (variable.inVariable || variable.outVariable) {