Unverified Commit 8207886e authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Fix logic for @#ifndef

Ref. dynare#1747

(cherry picked from commit df8d8ef1)
parent 5d461c0b
...@@ -306,8 +306,8 @@ Ifndef::interpret(ostream &output, vector<filesystem::path> &paths) ...@@ -306,8 +306,8 @@ Ifndef::interpret(ostream &output, vector<filesystem::path> &paths)
{ {
for (const auto & [expr, body] : expr_and_body) for (const auto & [expr, body] : expr_and_body)
if (VariablePtr vp = dynamic_pointer_cast<Variable>(expr); if (VariablePtr vp = dynamic_pointer_cast<Variable>(expr);
!(dynamic_pointer_cast<BaseType>(expr) dynamic_pointer_cast<BaseType>(expr)
|| (vp && env.isVariableDefined(vp->getName())))) || (vp && !env.isVariableDefined(vp->getName())))
{ {
interpretBody(body, output, paths); interpretBody(body, output, paths);
break; break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment