From fbfd2d7e176173b1a95c82425ffd136a69351d52 Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Mon, 13 Oct 2014 17:17:50 +0200
Subject: [PATCH] preprocessor: add field that contains the total number of
 equations, #728

---
 ModFile.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ModFile.cc b/ModFile.cc
index f31baf5f..553f0b3e 100644
--- a/ModFile.cc
+++ b/ModFile.cc
@@ -740,7 +740,8 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool no_log, b
   if (block && !byte_code)
     mOutputFile << "addpath " << basename << ";" << endl;
 
-  mOutputFile << "M_.orig_eq_nbr = " << orig_eqn_nbr << ";" << endl;
+  mOutputFile << "M_.orig_eq_nbr = " << orig_eqn_nbr << ";" << endl
+              << "M_.eq_nbr = " << dynamic_model.equation_number() << ";" << endl;
 
   if (dynamic_model.equation_number() > 0)
     {
-- 
GitLab