trunk preprocessor: added error message if model local variable (pound sign expression) used outside model scope
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@2168 ac1d8469-bf42-47a9-8791-bf33cf982152issue#70
parent
0794065726
commit
a8fa313ced
|
@ -196,6 +196,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;
|
||||
|
|
Loading…
Reference in New Issue