Forbid exogenous deterministic variables with a lead or lag

Ref. dynare#1765
issue#70
Sébastien Villemot 2021-01-22 11:59:44 +01:00
parent ab656f2d84
commit ec66768a63
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright © 2003-2020 Dynare Team
* Copyright © 2003-2021 Dynare Team
*
* This file is part of Dynare.
*
@ -398,6 +398,10 @@ ParsingDriver::add_model_variable(int symb_id, int lag)
error("Symbol " + mod_file->symbol_table.getName(symb_id)
+" is a function name external to Dynare. It cannot be used like a variable without input argument inside model.");
// See dynare#1765
if (type == SymbolType::exogenousDet && lag != 0)
error("Exogenous deterministic variable " + mod_file->symbol_table.getName(symb_id) + " cannot be given a lead or a lag.");
if (type == SymbolType::modelLocalVariable && lag != 0)
error("Model local variable " + mod_file->symbol_table.getName(symb_id) + " cannot be given a lead or a lag.");