preprocessor: fix bug in adl implementation that prevented the same parameter from being applied do different endogenosu variables
parent
2deb4b42fb
commit
843c4427b0
|
@ -657,10 +657,16 @@ SymbolTable::addAdlParameter(const string &basename, int lag) throw (FrozenExcep
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return addSymbol(varname.str(), eParameter);
|
int symb_id = addSymbol(varname.str(), eParameter);
|
||||||
|
adl_params.push_back(symb_id);
|
||||||
|
return symb_id;
|
||||||
}
|
}
|
||||||
catch (AlreadyDeclaredException &e)
|
catch (AlreadyDeclaredException &e)
|
||||||
{
|
{
|
||||||
|
int symb_id = getID(varname.str());
|
||||||
|
if (find(adl_params.begin(), adl_params.end(), symb_id) != adl_params.end())
|
||||||
|
return symb_id;
|
||||||
|
|
||||||
cerr << "ERROR: you should rename your variable called " << varname.str() << ", this name is internally used by Dynare" << endl;
|
cerr << "ERROR: you should rename your variable called " << varname.str() << ", this name is internally used by Dynare" << endl;
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,6 +153,9 @@ private:
|
||||||
//! Stores the list of observed exogenous variables
|
//! Stores the list of observed exogenous variables
|
||||||
vector<int> varexobs;
|
vector<int> varexobs;
|
||||||
|
|
||||||
|
//! Stores list of parameters declared in adl substitution
|
||||||
|
vector<int> adl_params;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SymbolTable();
|
SymbolTable();
|
||||||
//! Thrown when trying to access an unknown symbol (by name)
|
//! Thrown when trying to access an unknown symbol (by name)
|
||||||
|
|
Loading…
Reference in New Issue