Error out if an “initval” block appears after an “endval” block (without the “learnt_in=…” option)
Closes: #104master
parent
cffbb0f4fd
commit
ac35ef6101
|
@ -187,6 +187,12 @@ void
|
|||
InitValStatement::checkPass([[maybe_unused]] ModFileStructure &mod_file_struct,
|
||||
[[maybe_unused]] WarningConsolidation &warnings)
|
||||
{
|
||||
if (mod_file_struct.endval_present)
|
||||
{
|
||||
cerr << "ERROR: an 'initval' block cannot appear after an 'endval' block" << endl; // See #104
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
set<int> exogs = getUninitializedVariables(SymbolType::exogenous);
|
||||
set<int> endogs = getUninitializedVariables(SymbolType::endogenous);
|
||||
|
||||
|
@ -253,6 +259,8 @@ void
|
|||
EndValStatement::checkPass([[maybe_unused]] ModFileStructure &mod_file_struct,
|
||||
[[maybe_unused]] WarningConsolidation &warnings)
|
||||
{
|
||||
mod_file_struct.endval_present = true;
|
||||
|
||||
set<int> exogs = getUninitializedVariables(SymbolType::exogenous);
|
||||
set<int> endogs = getUninitializedVariables(SymbolType::endogenous);
|
||||
|
||||
|
|
|
@ -157,6 +157,8 @@ struct ModFileStructure
|
|||
/* Lists symbol IDs of parameters that appear in a “planner_discount” option.
|
||||
See dynare#1173 for more details. */
|
||||
set<int> parameters_in_planner_discount;
|
||||
// Whether an endval block (without the learnt_it=… option) appears
|
||||
bool endval_present{false};
|
||||
// Whether a shocks(surprise) block appears
|
||||
bool shocks_surprise_present{false};
|
||||
// Whether a shocks(learnt_in=…) block appears
|
||||
|
|
Loading…
Reference in New Issue