diff --git a/src/parser/prismparser/PrismGrammar.cpp b/src/parser/prismparser/PrismGrammar.cpp index 992e9c039..2b59fdf5d 100644 --- a/src/parser/prismparser/PrismGrammar.cpp +++ b/src/parser/prismparser/PrismGrammar.cpp @@ -80,15 +80,19 @@ Module PrismGrammar::createModule(std::string const& name, std::vector const& lower, std::shared_ptr const& upper, std::shared_ptr const& init, std::vector& vars, std::map& varids) { uint_fast64_t id = this->state->addIntegerVariable(name); - vars.emplace_back(this->state->nextLocalIntegerVariableIndex++, id, name, lower, upper, init); - varids[name] = id; + uint_fast64_t newLocalIndex = this->state->nextLocalIntegerVariableIndex; + vars.emplace_back(newLocalIndex, id, name, lower, upper, init); + varids[name] = newLocalIndex; + ++this->state->nextLocalIntegerVariableIndex; this->state->localIntegerVariables_.add(name, name); } void PrismGrammar::createBooleanVariable(std::string const& name, std::shared_ptr const& init, std::vector& vars, std::map& varids) { uint_fast64_t id = this->state->addBooleanVariable(name); - vars.emplace_back(this->state->nextLocalIntegerVariableIndex++, id, name, init); - varids[name] = id; + uint_fast64_t newLocalIndex = this->state->nextLocalBooleanVariableIndex; + vars.emplace_back(newLocalIndex, id, name, init); + varids[name] = newLocalIndex; + ++this->state->nextLocalBooleanVariableIndex; this->state->localBooleanVariables_.add(name, name); }