Commit 6cf4e6dc authored by Sébastien Villemot's avatar Sébastien Villemot

Port to C++11 range-based for loops

Performed using modernize-loop-convert from clang-tidy.

Manual intervention was needed in MacroValue.cc because of a variable name
capture issue.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-loop-convert.html
parent 80d1e1e1
This diff is collapsed.
This diff is collapsed.
......@@ -46,8 +46,8 @@ DataTree::DataTree(SymbolTable &symbol_table_arg,
DataTree::~DataTree()
{
for (node_list_t::iterator it = node_list.begin(); it != node_list.end(); it++)
delete *it;
for (auto & it : node_list)
delete it;
}
expr_t
......@@ -75,9 +75,8 @@ DataTree::AddVariableInternal(int symb_id, int lag)
bool
DataTree::ParamUsedWithLeadLagInternal() const
{
for (variable_node_map_t::const_iterator it = variable_node_map.begin();
it != variable_node_map.end(); it++)
if (symbol_table.getType(it->first.first) == eParameter && it->first.second != 0)
for (const auto & it : variable_node_map)
if (symbol_table.getType(it.first.first) == eParameter && it.first.second != 0)
return true;
return false;
}
......@@ -588,9 +587,8 @@ DataTree::AddSecondDerivExternalFunction(int top_level_symb_id, const vector<exp
bool
DataTree::isSymbolUsed(int symb_id) const
{
for (variable_node_map_t::const_iterator it = variable_node_map.begin();
it != variable_node_map.end(); it++)
if (it->first.first == symb_id)
for (const auto & it : variable_node_map)
if (it.first.first == symb_id)
return true;
if (local_variables_table.find(symb_id) != local_variables_table.end())
......@@ -637,9 +635,8 @@ DataTree::getDynJacobianCol(int deriv_id) const throw (UnknownDerivIDException)
bool
DataTree::isUnaryOpUsed(UnaryOpcode opcode) const
{
for (unary_op_node_map_t::const_iterator it = unary_op_node_map.begin();
it != unary_op_node_map.end(); it++)
if (it->first.first.second == opcode)
for (const auto & it : unary_op_node_map)
if (it.first.first.second == opcode)
return true;
return false;
......@@ -648,9 +645,8 @@ DataTree::isUnaryOpUsed(UnaryOpcode opcode) const
bool
DataTree::isBinaryOpUsed(BinaryOpcode opcode) const
{
for (binary_op_node_map_t::const_iterator it = binary_op_node_map.begin();
it != binary_op_node_map.end(); it++)
if (it->first.second == opcode)
for (const auto & it : binary_op_node_map)
if (it.first.second == opcode)
return true;
return false;
......@@ -659,9 +655,8 @@ DataTree::isBinaryOpUsed(BinaryOpcode opcode) const
bool
DataTree::isTrinaryOpUsed(TrinaryOpcode opcode) const
{
for (trinary_op_node_map_t::const_iterator it = trinary_op_node_map.begin();
it != trinary_op_node_map.end(); it++)
if (it->first.second == opcode)
for (const auto & it : trinary_op_node_map)
if (it.first.second == opcode)
return true;
return false;
......@@ -670,9 +665,8 @@ DataTree::isTrinaryOpUsed(TrinaryOpcode opcode) const
bool
DataTree::isExternalFunctionUsed(int symb_id) const
{
for (external_function_node_map_t::const_iterator it = external_function_node_map.begin();
it != external_function_node_map.end(); it++)
if (it->first.second == symb_id)
for (const auto & it : external_function_node_map)
if (it.first.second == symb_id)
return true;
return false;
......@@ -681,9 +675,8 @@ DataTree::isExternalFunctionUsed(int symb_id) const
bool
DataTree::isFirstDerivExternalFunctionUsed(int symb_id) const
{
for (first_deriv_external_function_node_map_t::const_iterator it = first_deriv_external_function_node_map.begin();
it != first_deriv_external_function_node_map.end(); it++)
if (it->first.second == symb_id)
for (const auto & it : first_deriv_external_function_node_map)
if (it.first.second == symb_id)
return true;
return false;
......@@ -692,9 +685,8 @@ DataTree::isFirstDerivExternalFunctionUsed(int symb_id) const
bool
DataTree::isSecondDerivExternalFunctionUsed(int symb_id) const
{
for (second_deriv_external_function_node_map_t::const_iterator it = second_deriv_external_function_node_map.begin();
it != second_deriv_external_function_node_map.end(); it++)
if (it->first.second == symb_id)
for (const auto & it : second_deriv_external_function_node_map)
if (it.first.second == symb_id)
return true;
return false;
......@@ -704,10 +696,9 @@ int
DataTree::minLagForSymbol(int symb_id) const
{
int r = 0;
for (variable_node_map_t::const_iterator it = variable_node_map.begin();
it != variable_node_map.end(); ++it)
if (it->first.first == symb_id && it->first.second < r)
r = it->first.second;
for (const auto & it : variable_node_map)
if (it.first.first == symb_id && it.first.second < r)
r = it.first.second;
return r;
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -116,9 +116,8 @@ inline int
ExternalFunctionsTable::get_total_number_of_unique_model_block_external_functions() const
{
int number_of_unique_model_block_external_functions = 0;
for (external_function_table_type::const_iterator it = externalFunctionTable.begin();
it != externalFunctionTable.end(); it++)
if (it->second.nargs > 0)
for (auto it : externalFunctionTable)
if (it.second.nargs > 0)
number_of_unique_model_block_external_functions++;
return number_of_unique_model_block_external_functions;
......
......@@ -48,9 +48,8 @@ ModFile::ModFile(WarningConsolidation &warnings_arg)
ModFile::~ModFile()
{
for (vector<Statement *>::iterator it = statements.begin();
it != statements.end(); it++)
delete (*it);
for (auto & statement : statements)
delete statement;
}
void
......@@ -112,9 +111,8 @@ ModFile::addStatementAtFront(Statement *st)
void
ModFile::checkPass(bool nostrict, bool stochastic)
{
for (vector<Statement *>::iterator it = statements.begin();
it != statements.end(); it++)
(*it)->checkPass(mod_file_struct, warnings);
for (auto & statement : statements)
statement->checkPass(mod_file_struct, warnings);
// Check the steady state block
steady_state_model.checkPass(mod_file_struct, warnings);
......@@ -332,8 +330,8 @@ ModFile::checkPass(bool nostrict, bool stochastic)
if (unusedExo.size() > 0)
{
ostringstream unused_exos;
for (set<int>::iterator it = unusedExo.begin(); it != unusedExo.end(); it++)
unused_exos << symbol_table.getName(*it) << " ";
for (int it : unusedExo)
unused_exos << symbol_table.getName(it) << " ";
if (nostrict)
warnings << "WARNING: " << unused_exos.str()
......@@ -358,10 +356,10 @@ ModFile::transformPass(bool nostrict, bool stochastic, bool compute_xrefs, const
if (nostrict)
{
set<int> unusedEndogs = dynamic_model.findUnusedEndogenous();
for (set<int>::iterator it = unusedEndogs.begin(); it != unusedEndogs.end(); it++)
for (int unusedEndog : unusedEndogs)
{
symbol_table.changeType(*it, eUnusedEndogenous);
warnings << "WARNING: '" << symbol_table.getName(*it)
symbol_table.changeType(unusedEndog, eUnusedEndogenous);
warnings << "WARNING: '" << symbol_table.getName(unusedEndog)
<< "' not used in model block, removed by nostrict command-line option" << endl;
}
}
......@@ -462,9 +460,9 @@ ModFile::transformPass(bool nostrict, bool stochastic, bool compute_xrefs, const
if (mod_file_struct.ramsey_model_present)
{
StaticModel *planner_objective = NULL;
for (vector<Statement *>::iterator it = statements.begin(); it != statements.end(); it++)
for (auto & statement : statements)
{
PlannerObjectiveStatement *pos = dynamic_cast<PlannerObjectiveStatement *>(*it);
PlannerObjectiveStatement *pos = dynamic_cast<PlannerObjectiveStatement *>(statement);
if (pos != NULL)
planner_objective = pos->getPlannerObjective();
}
......@@ -597,9 +595,9 @@ ModFile::transformPass(bool nostrict, bool stochastic, bool compute_xrefs, const
}
if (mod_file_struct.ramsey_policy_present)
for (vector<Statement *>::iterator it = statements.begin(); it != statements.end(); it++)
for (auto & statement : statements)
{
RamseyPolicyStatement *rps = dynamic_cast<RamseyPolicyStatement *>(*it);
RamseyPolicyStatement *rps = dynamic_cast<RamseyPolicyStatement *>(statement);
if (rps != NULL)
rps->checkRamseyPolicyList();
}
......@@ -727,9 +725,8 @@ ModFile::computingPass(bool no_tmp_terms, FileOutputType output, int params_deri
}
}
for (vector<Statement *>::iterator it = statements.begin();
it != statements.end(); it++)
(*it)->computingPass();
for (auto & statement : statements)
statement->computingPass();
}
void
......@@ -848,14 +845,14 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
if (parallel_local_files.size() > 0)
{
mOutputFile << "options_.parallel_info.local_files = {" << endl;
for (size_t i = 0; i < parallel_local_files.size(); i++)
for (const auto & parallel_local_file : parallel_local_files)
{
size_t j = parallel_local_files[i].find_last_of("/\\");
size_t j = parallel_local_file.find_last_of("/\\");
if (j == string::npos)
mOutputFile << "'', '" << parallel_local_files[i] << "';" << endl;
mOutputFile << "'', '" << parallel_local_file << "';" << endl;
else
mOutputFile << "'" << parallel_local_files[i].substr(0, j+1) << "', '"
<< parallel_local_files[i].substr(j+1, string::npos) << "';" << endl;
mOutputFile << "'" << parallel_local_file.substr(0, j+1) << "', '"
<< parallel_local_file.substr(j+1, string::npos) << "';" << endl;
}
mOutputFile << "};" << endl;
}
......@@ -985,14 +982,13 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
// (*it)->writeOutput(mOutputFile, basename, minimal_workspace);
// dynamic_model.writeVarExpectationFunctions(mOutputFile);
for (vector<Statement *>::const_iterator it = statements.begin();
it != statements.end(); it++)
for (auto statement : statements)
{
(*it)->writeOutput(mOutputFile, basename, minimal_workspace);
statement->writeOutput(mOutputFile, basename, minimal_workspace);
/* Special treatment for initval block: insert initial values for the
auxiliary variables and initialize exo det */
InitValStatement *ivs = dynamic_cast<InitValStatement *>(*it);
InitValStatement *ivs = dynamic_cast<InitValStatement *>(statement);
if (ivs != NULL)
{
static_model.writeAuxVarInitval(mOutputFile, oMatlabOutsideModel);
......@@ -1000,17 +996,17 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
}
// Special treatment for endval block: insert initial values for the auxiliary variables
EndValStatement *evs = dynamic_cast<EndValStatement *>(*it);
EndValStatement *evs = dynamic_cast<EndValStatement *>(statement);
if (evs != NULL)
static_model.writeAuxVarInitval(mOutputFile, oMatlabOutsideModel);
// Special treatment for load params and steady state statement: insert initial values for the auxiliary variables
LoadParamsAndSteadyStateStatement *lpass = dynamic_cast<LoadParamsAndSteadyStateStatement *>(*it);
LoadParamsAndSteadyStateStatement *lpass = dynamic_cast<LoadParamsAndSteadyStateStatement *>(statement);
if (lpass && !no_static)
static_model.writeAuxVarInitval(mOutputFile, oMatlabOutsideModel);
// Special treatement for Var Models
VarModelStatement *vms = dynamic_cast<VarModelStatement *>(*it);
VarModelStatement *vms = dynamic_cast<VarModelStatement *>(statement);
if (vms != NULL)
vms->createVarModelMFunction(mOutputFile, dynamic_model.getVarExpectationFunctionsToWrite());
}
......@@ -1162,9 +1158,8 @@ ModFile::writeModelC(const string &basename) const
}
// Print statements
for (vector<Statement *>::const_iterator it = statements.begin();
it != statements.end(); it++)
(*it)->writeCOutput(mDriverCFile, basename);
for (auto statement : statements)
statement->writeCOutput(mDriverCFile, basename);
mDriverCFile << "} DynareInfo;" << endl;
mDriverCFile.close();
......@@ -1267,9 +1262,8 @@ ModFile::writeModelCC(const string &basename) const
}
// Print statements
for (vector<Statement *>::const_iterator it = statements.begin();
it != statements.end(); it++)
(*it)->writeCOutput(mDriverCFile, basename);
for (auto statement : statements)
statement->writeCOutput(mDriverCFile, basename);
mDriverCFile << "};" << endl;
mDriverCFile.close();
......@@ -1404,9 +1398,8 @@ ModFile::writeExternalFilesJulia(const string &basename, FileOutputType output,
steady_state_model.writeSteadyStateFile(basename, mod_file_struct.ramsey_model_present, true);
// Print statements (includes parameter values)
for (vector<Statement *>::const_iterator it = statements.begin();
it != statements.end(); it++)
(*it)->writeJuliaOutput(jlOutputFile, basename);
for (auto statement : statements)
statement->writeJuliaOutput(jlOutputFile, basename);
jlOutputFile << "model_.static = " << basename << "Static.static!" << endl
<< "model_.dynamic = " << basename << "Dynamic.dynamic!" << endl
......
This diff is collapsed.
......@@ -106,12 +106,11 @@ InitOrEndValStatement::InitOrEndValStatement(const init_values_t &init_values_ar
void
InitOrEndValStatement::fillEvalContext(eval_context_t &eval_context) const
{
for (init_values_t::const_iterator it = init_values.begin();
it != init_values.end(); it++)
for (const auto & init_value : init_values)
{
try
{
eval_context[it->first] = (it->second)->eval(eval_context);
eval_context[init_value.first] = (init_value.second)->eval(eval_context);
}
catch (ExprNode::EvalException &e)
{
......@@ -138,10 +137,9 @@ InitOrEndValStatement::getUninitializedVariables(SymbolType type)
}
set<int>::iterator sit;
for (init_values_t::const_iterator it = init_values.begin();
it != init_values.end(); it++)
for (const auto & init_value : init_values)
{
sit = unused.find(it->first);
sit = unused.find(init_value.first);
if (sit != unused.end())
unused.erase(sit);
}
......@@ -151,11 +149,10 @@ InitOrEndValStatement::getUninitializedVariables(SymbolType type)
void
InitOrEndValStatement::writeInitValues(ostream &output) const
{
for (init_values_t::const_iterator it = init_values.begin();
it != init_values.end(); it++)
for (const auto & init_value : init_values)
{
const int symb_id = it->first;
const expr_t expression = it->second;
const int symb_id = init_value.first;
const expr_t expression = init_value.second;
SymbolType type = symbol_table.getType(symb_id);
int tsid = symbol_table.getTypeSpecificID(symb_id) + 1;
......@@ -203,16 +200,16 @@ InitValStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidat
if (endogs.size() > 0)
{
cerr << "ERROR: You have not set the following endogenous variables in initval:";
for (set<int>::const_iterator it = endogs.begin(); it != endogs.end(); it++)
cerr << " " << symbol_table.getName(*it);
for (int endog : endogs)
cerr << " " << symbol_table.getName(endog);
cerr << endl;
}
if (exogs.size() > 0)
{
cerr << "ERROR: You have not set the following exogenous variables in initval:";
for (set<int>::const_iterator it = exogs.begin(); it != exogs.end(); it++)
cerr << " " << symbol_table.getName(*it);
for (int exog : exogs)
cerr << " " << symbol_table.getName(exog);
cerr << endl;
}
......@@ -267,16 +264,16 @@ EndValStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidati
if (endogs.size() > 0)
{
cerr << "ERROR: You have not set the following endogenous variables in endval:";
for (set<int>::const_iterator it = endogs.begin(); it != endogs.end(); it++)
cerr << " " << symbol_table.getName(*it);
for (int endog : endogs)
cerr << " " << symbol_table.getName(endog);
cerr << endl;
}
if (exogs.size() > 0)
{
cerr << "ERROR: You have not set the following exogenous variables in endval:";
for (set<int>::const_iterator it = exogs.begin(); it != exogs.end(); it++)
cerr << " " << symbol_table.getName(*it);
for (int exog : exogs)
cerr << " " << symbol_table.getName(exog);
cerr << endl;
}
......@@ -325,14 +322,13 @@ HistValStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidat
set<int> unused_exo = symbol_table.getExogenous();
set<int>::iterator sit;
for (hist_values_t::const_iterator it = hist_values.begin();
it != hist_values.end(); it++)
for (const auto & hist_value : hist_values)
{
sit = unused_endo.find(it->first.first);
sit = unused_endo.find(hist_value.first.first);
if (sit != unused_endo.end())
unused_endo.erase(sit);
sit = unused_exo.find(it->first.first);
sit = unused_exo.find(hist_value.first.first);
if (sit != unused_exo.end())
unused_exo.erase(sit);
}
......@@ -340,16 +336,16 @@ HistValStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidat
if (unused_endo.size() > 0)
{
cerr << "ERROR: You have not set the following endogenous variables in histval:";
for (set<int>::const_iterator it = unused_endo.begin(); it != unused_endo.end(); it++)
cerr << " " << symbol_table.getName(*it);
for (int it : unused_endo)
cerr << " " << symbol_table.getName(it);
cerr << endl;
}
if (unused_exo.size() > 0)
{
cerr << "ERROR: You have not set the following exogenous variables in endval:";
for (set<int>::const_iterator it = unused_exo.begin(); it != unused_exo.end(); it++)
cerr << " " << symbol_table.getName(*it);
for (int it : unused_exo)
cerr << " " << symbol_table.getName(it);
cerr << endl;
}
......@@ -369,12 +365,11 @@ HistValStatement::writeOutput(ostream &output, const string &basename, bool mini
<< "M_.exo_histval = zeros(M_.exo_nbr,M_.maximum_lag);" << endl
<< "M_.exo_det_histval = zeros(M_.exo_det_nbr,M_.maximum_lag);" << endl;
for (hist_values_t::const_iterator it = hist_values.begin();
it != hist_values.end(); it++)
for (const auto & hist_value : hist_values)
{
int symb_id = it->first.first;
int lag = it->first.second;
const expr_t expression = it->second;
int symb_id = hist_value.first.first;
int lag = hist_value.first.second;
const expr_t expression = hist_value.second;
SymbolType type = symbol_table.getType(symb_id);
......@@ -489,12 +484,11 @@ HomotopyStatement::writeOutput(ostream &output, const string &basename, bool min
<< "%" << endl
<< "options_.homotopy_values = [];" << endl;
for (homotopy_values_t::const_iterator it = homotopy_values.begin();
it != homotopy_values.end(); it++)
for (const auto & homotopy_value : homotopy_values)
{
const int &symb_id = it->first;
const expr_t expression1 = it->second.first;
const expr_t expression2 = it->second.second;
const int &symb_id = homotopy_value.first;
const expr_t expression1 = homotopy_value.second.first;
const expr_t expression2 = homotopy_value.second.second;
const SymbolType type = symbol_table.getType(symb_id);
const int tsid = symbol_table.getTypeSpecificID(symb_id) + 1;
......@@ -591,10 +585,9 @@ LoadParamsAndSteadyStateStatement::LoadParamsAndSteadyStateStatement(const strin
void
LoadParamsAndSteadyStateStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
{
for (map<int, string>::const_iterator it = content.begin();
it != content.end(); it++)
for (const auto & it : content)
{
switch (symbol_table.getType(it->first))
switch (symbol_table.getType(it.first))
{
case eParameter:
output << "M_.params";
......@@ -609,12 +602,12 @@ LoadParamsAndSteadyStateStatement::writeOutput(ostream &output, const string &ba
output << "oo_.exo_det_steady_state";
break;
default:
cerr << "ERROR: Unsupported variable type for " << symbol_table.getName(it->first) << " in load_params_and_steady_state" << endl;
cerr << "ERROR: Unsupported variable type for " << symbol_table.getName(it.first) << " in load_params_and_steady_state" << endl;
exit(EXIT_FAILURE);
}
int tsid = symbol_table.getTypeSpecificID(it->first) + 1;
output << "(" << tsid << ") = " << it->second << ";" << endl;
int tsid = symbol_table.getTypeSpecificID(it.first) + 1;
output << "(" << tsid << ") = " << it.second << ";" << endl;
}
}
......@@ -638,7 +631,6 @@ LoadParamsAndSteadyStateStatement::writeJsonOutput(ostream &output) const
void
LoadParamsAndSteadyStateStatement::fillEvalContext(eval_context_t &eval_context) const
{
for (map<int, string>::const_iterator it = content.begin();
it != content.end(); it++)
eval_context[it->first] = atof(it->second.c_str());
for (const auto & it : content)
eval_context[it.first] = atof(it.second.c_str());
}
......@@ -215,12 +215,11 @@ ParsingDriver::declare_endogenous(string *name, string *tex_name, vector<pair<st
delete tex_name;
if (partition_value != NULL)
{
for (vector<pair<string *, string *> *>::iterator it = partition_value->begin();
it != partition_value->end(); ++it)
for (auto & it : *partition_value)
{
delete (*it)->first;
delete (*it)->second;
delete (*it);
delete it->first;
delete it->second;
delete it;
}
delete partition_value;
}
......@@ -252,12 +251,11 @@ ParsingDriver::declare_exogenous(string *name, string *tex_name, vector<pair<str
delete tex_name;
if (partition_value != NULL)
{
for (vector<pair<string *, string *> *>::iterator it = partition_value->begin();
it != partition_value->end(); ++it)
for (auto & it : *partition_value)
{
delete (*it)->first;
delete (*it)->second;
delete (*it);
delete it->first;
delete it->second;
delete it;
}
delete partition_value;
}
......@@ -272,12 +270,11 @@ ParsingDriver::declare_exogenous_det(string *name, string *tex_name, vector<pair
delete tex_name;
if (partition_value != NULL)
{
for (vector<pair<string *, string *> *>::iterator it = partition_value->begin();
it != partition_value->end(); ++it)
for (auto & it : *partition_value)
{
delete (*it)->first;
delete (*it)->second;
delete (*it);
delete it->first;
delete it->second;
delete it;
}
delete partition_value;
}
......@@ -292,12 +289,11 @@ ParsingDriver::declare_parameter(string *name, string *tex_name, vector<pair<str
delete tex_name;
if (partition_value != NULL)
{
for (vector<pair<string *, string *> *>::iterator it = partition_value->begin();
it != partition_value->end(); ++it)
for (auto & it : *partition_value)
{
delete (*it)->first;
delete (*it)->second;
delete (*it);
delete it->first;
delete it->second;
delete it;
}
delete partition_value;
}
......@@ -552,8 +548,8 @@ ParsingDriver::end_nonstationary_var(bool log_deflator, expr_t deflator)
set<int> r;
deflator->collectVariables(eEndogenous, r);
for (set<int>::const_iterator it = r.begin(); it != r.end(); ++it)
if (dynamic_model->isNonstationary(*it))
for (int it : r)
if (dynamic_model->isNonstationary(it))
error("The deflator contains a non-stationary endogenous variable. This is not allowed. Please use only stationary endogenous and/or {log_}trend_vars.");
declared_nonstationary_vars.clear();
......@@ -2306,9 +2302,8 @@ ParsingDriver::run_identification()
void
ParsingDriver::add_mc_filename(string *filename, string *prior)
{
for (ModelComparisonStatement::filename_list_t::iterator it = filename_list.begin();
it != filename_list.end(); it++)
if ((*it).first == *filename)
for (auto & it : filename_list)
if (it.first == *filename)
error("model_comparison: filename " + *filename + " declared twice");
filename_list.push_back(make_pair(*filename, *prior));
delete filename;
......@@ -2505,8 +2500,8 @@ ParsingDriver::svar()
itv = options_list.vector_int_options.find("ms.equations");
if (itv != options_list.vector_int_options.end())
for (vector<int>::const_iterator viit = itv->second.begin(); viit != itv->second.end(); viit++)
if (*viit <= 0)
for (int viit : itv->second)
if (viit <= 0)
error("The value(s) passed to the equation option must be greater than zero.");
mod_file->addStatement(new SvarStatement(options_list));
......@@ -2688,27 +2683,26 @@ ParsingDriver::declare_and_init_model_local_variable(string *name, expr_t rhs)
void
ParsingDriver::change_type(SymbolType new_type, vector<string *> *var_list)
{
for (vector<string *>::iterator it = var_list->begin();
it != var_list->end(); it++)
for (auto & it : *var_list)
{
int id;
try
{
id = mod_file->symbol_table.getID(**it);
id = mod_file->symbol_table.getID(*it);
}
catch (SymbolTable::UnknownSymbolNameException &e)
{
error("Unknown variable " + **it);
error("Unknown variable " + *it);
}