preprocessor: fix bug introduced in c9ca46f228c73dc8b85322109f896cc32f446a7c. Further simplify ParsingDriver::declare_nonstationary_var(). Closes #1184

issue#70
Houtan Bastani 2016-05-09 16:00:18 +02:00
parent 4462591347
commit 8f2007fac5
1 changed files with 3 additions and 11 deletions

View File

@ -376,23 +376,15 @@ ParsingDriver::declare_nonstationary_var(string *name, string *tex_name, pair<st
declare_endogenous(new string(*name));
else
if (tex_name == NULL)
declare_endogenous(new string(*name), NULL, new pair<string *, string *>(*partition_value));
declare_endogenous(new string(*name), NULL, partition_value);
else if (partition_value == NULL)
declare_endogenous(new string(*name), new string(*tex_name));
declare_endogenous(new string(*name), tex_name);
else
declare_endogenous(new string(*name), new string(*tex_name), new pair<string *, string *>(*partition_value));
declare_endogenous(new string(*name), tex_name, partition_value);
declared_nonstationary_vars.push_back(mod_file->symbol_table.getID(*name));
mod_file->nonstationary_variables = true;
delete name;
if (tex_name != NULL)
delete tex_name;
if (partition_value != NULL)
{
delete partition_value->first;
delete partition_value->second;
delete partition_value;
}
}
void