Displays an error message when the model contains pound expressions and 'bytecode' or 'block' options are present
parent
b91dd27096
commit
fd923d428d
|
@ -4175,3 +4175,16 @@ DynamicModel::fillEvalContext(eval_context_t &eval_context) const
|
|||
it != trendVars.end(); it++)
|
||||
eval_context[*it] = 2; //not <= 0 bc of log, not 1 bc of powers
|
||||
}
|
||||
|
||||
bool
|
||||
DynamicModel::isModelLocalVariableUsed() const
|
||||
{
|
||||
set<int> used_local_vars;
|
||||
size_t i = 0;
|
||||
while (i < equations.size() && used_local_vars.size() == 0)
|
||||
{
|
||||
equations[i]->collectModelLocalVariables(used_local_vars);
|
||||
i++;
|
||||
}
|
||||
return used_local_vars.size() > 0;
|
||||
}
|
||||
|
|
|
@ -476,6 +476,7 @@ public:
|
|||
else
|
||||
return (-1);
|
||||
};
|
||||
bool isModelLocalVariableUsed() const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -163,6 +163,13 @@ ModFile::checkPass()
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (block || byte_code)
|
||||
if (dynamic_model.isModelLocalVariableUsed())
|
||||
{
|
||||
cerr << "ERROR: In 'model' block, 'block' or 'bytecode' options are not yet compatible with pound expressions" << endl;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if ((stochastic_statement_present || mod_file_struct.check_present || mod_file_struct.steady_present) && no_static)
|
||||
{
|
||||
cerr << "ERROR: no_static option is incompatible with stoch_simul, estimation, osr, ramsey_policy, discretionary_policy, steady and check commands" << endl;
|
||||
|
|
Loading…
Reference in New Issue