Skip to content
Snippets Groups Projects
Commit 7729c438 authored by sebastien's avatar sebastien
Browse files

4.0: merged r2168 changeset (forbid usage of model local variables outside model scope)

git-svn-id: https://www.dynare.org/svn/dynare/branches/4.0@2209 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 3fab9d5c
No related branches found
No related tags found
Loading
......@@ -207,6 +207,10 @@ ParsingDriver::add_expression_variable(string *name)
if (!mod_file->symbol_table.exists(*name))
mod_file->symbol_table.addSymbol(*name, eModFileLocalVariable);
// This check must come after the previous one!
if (mod_file->symbol_table.getType(*name) == eModelLocalVariable)
error("Variable " + *name + " not allowed outside model declaration. Its scope is only inside model.");
NodeID id = data_tree->AddVariable(*name);
delete name;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment