preprocessor: histval should only accept lag values <= 0. closes #1510

issue#70
Houtan Bastani 2017-09-13 10:16:19 +02:00
parent 4213c42b96
commit 113b8799f3
1 changed files with 3 additions and 0 deletions

View File

@ -546,6 +546,9 @@ ParsingDriver::hist_val(string *name, string *lag, expr_t rhs)
error("histval: " + *name + " should be an endogenous or exogenous variable");
int ilag = atoi(lag->c_str());
if (ilag > 0)
error("histval: the lag on " + *name + " should be less than or equal to 0");
pair<int, int> key(symb_id, ilag);
if (mod_file->dynamic_model.minLagForSymbol(symb_id) > ilag - 1)