From b9295061ec608bf09ba4af51552afe96a6d4e56e Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Tue, 20 Feb 2018 09:27:26 +0100
Subject: [PATCH] pac_expectation: fix bug introduced in
 c3552e034cfe8d35bdf1cf5e05163822d3820938

---
 ExprNode.cc | 38 ++++++++++++++++++++------------------
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/ExprNode.cc b/ExprNode.cc
index 6176389e..687b6bde 100644
--- a/ExprNode.cc
+++ b/ExprNode.cc
@@ -7439,25 +7439,27 @@ PacExpectationNode::writeOutput(ostream &output, ExprNodeOutputType output_type,
          << "M_.pac_expectation." << model_name << ".lhs_lag = " << lhs_pac_var.second << ";" << endl;
 
   if (growth_symb_id >= 0)
-    output << "M_.pac_expectation." << model_name << ".growth_neutrality_param_index = "
-           << datatree.symbol_table.getTypeSpecificID(growth_param_index) + 1 << ";" << endl
-           << "M_.pac_expectation." << model_name << ".growth_index = "
-           << datatree.symbol_table.getTypeSpecificID(growth_symb_id) + 1 << ";" << endl
-           << "M_.pac_expectation." << model_name << ".growth_type = ";
-  switch(datatree.symbol_table.getType(growth_symb_id))
     {
-    case eEndogenous:
-      output << "'endogenous';" << endl;
-      break;
-    case eExogenous:
-      output << "'exogenous';" << endl;
-      break;
-    case eParameter:
-      output << "'exogenous';" << endl;
-      break;
-    default:
-      cerr << "pac_expectation: error encountered in growth type" << endl;
-      exit(EXIT_FAILURE);
+      output << "M_.pac_expectation." << model_name << ".growth_neutrality_param_index = "
+             << datatree.symbol_table.getTypeSpecificID(growth_param_index) + 1 << ";" << endl
+             << "M_.pac_expectation." << model_name << ".growth_index = "
+             << datatree.symbol_table.getTypeSpecificID(growth_symb_id) + 1 << ";" << endl
+             << "M_.pac_expectation." << model_name << ".growth_type = ";
+      switch(datatree.symbol_table.getType(growth_symb_id))
+        {
+        case eEndogenous:
+          output << "'endogenous';" << endl;
+          break;
+        case eExogenous:
+          output << "'exogenous';" << endl;
+          break;
+        case eParameter:
+          output << "'exogenous';" << endl;
+          break;
+        default:
+          cerr << "pac_expectation: error encountered in growth type" << endl;
+          exit(EXIT_FAILURE);
+        }
     }
 
   output << "M_.pac_expectation." << model_name << ".equation_params = [";
-- 
GitLab