Commit d1e5b0d4 authored by sebastien's avatar sebastien
Browse files

trunk preprocessor: added error message if model local variable (pound sign...

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-bf33cf982152
parent 59fad3df
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment