From f5087903ae132fb22cbb5ebaa0ee634871f62b9d Mon Sep 17 00:00:00 2001
From: Jochem Snuverink <jochem.snuverink@psi.ch>
Date: Tue, 4 Aug 2020 14:09:29 +0200
Subject: [PATCH] don't execute relevant code in assert; use PAssert; add
 copyright header

---
 src/OpalParser/MacroCmd.cpp | 42 +++++++++++++++++++++----------------
 src/OpalParser/MacroCmd.h   | 42 +++++++++++++++++++------------------
 2 files changed, 46 insertions(+), 38 deletions(-)

diff --git a/src/OpalParser/MacroCmd.cpp b/src/OpalParser/MacroCmd.cpp
index 76dec8e9c..f2c43bf97 100644
--- a/src/OpalParser/MacroCmd.cpp
+++ b/src/OpalParser/MacroCmd.cpp
@@ -1,30 +1,35 @@
-// ------------------------------------------------------------------------
-// $RCSfile: MacroCmd.cpp,v $
-// ------------------------------------------------------------------------
-// $Revision: 1.1.1.1 $
-// ------------------------------------------------------------------------
-// Copyright: see Copyright.readme
-// ------------------------------------------------------------------------
 //
-// Class: MacroCmd
+// Class MacroCmd
+//
+//   This class parses the MACRO command.
+//   Encapsulate the buffer for the ``archetypes'' of all macros.
+//   The macro is stored as a MacroStream.  For execution, first the
+//   parameters are replaced, then the resulting stream is sent to the parser.
+//
+// Copyright (c) 2008 - 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
+//
+// All rights reserved
+//
+// This file is part of OPAL.
 //
-// ------------------------------------------------------------------------
+// OPAL is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
 //
-// $Date: 2000/03/27 09:33:43 $
-// $Author: Andreas Adelmann $
+// You should have received a copy of the GNU General Public License
+// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
 //
-// ------------------------------------------------------------------------
 
 #include "OpalParser/MacroCmd.h"
+
+#include "Utility/PAssert.h"
+
 #include "AbstractObjects/OpalData.h"
 #include "OpalParser/OpalParser.h"
 #include "Parser/Statement.h"
 #include "Utilities/ParseError.h"
 #include <vector>
-#include <cassert>
-
-// Class MacroCmd
-// ------------------------------------------------------------------------
 
 MacroCmd::MacroCmd():
     Macro(0u, "MACRO",
@@ -99,7 +104,8 @@ Object *MacroCmd::makeTemplate
     macro->parseFormals(statement);
 
     // Parse macro body->
-    assert(statement.keyword("MACRO"));
+    bool isMacro = statement.keyword("MACRO");
+    PAssert(isMacro);
     Token token;
 
     if(statement.delimiter('{')) {
@@ -126,4 +132,4 @@ Object *MacroCmd::makeTemplate
     }
 
     return macro;
-}
+}
\ No newline at end of file
diff --git a/src/OpalParser/MacroCmd.h b/src/OpalParser/MacroCmd.h
index 79d2ec6f3..4aab1eeac 100644
--- a/src/OpalParser/MacroCmd.h
+++ b/src/OpalParser/MacroCmd.h
@@ -1,34 +1,36 @@
-#ifndef CLASSIC_MacroCmd_HH
-#define CLASSIC_MacroCmd_HH
-
-// ------------------------------------------------------------------------
-// $RCSfile: MacroCmd.h,v $
-// ------------------------------------------------------------------------
-// $Revision: 1.1.1.1 $
-// ------------------------------------------------------------------------
-// Copyright: see Copyright.readme
-// ------------------------------------------------------------------------
 //
-// Class: MacroCmd
+// Class MacroCmd
 //
-// ------------------------------------------------------------------------
+//   This class parses the MACRO command.
+//   Encapsulate the buffer for the ``archetypes'' of all macros.
+//   The macro is stored as a MacroStream.  For execution, first the
+//   parameters are replaced, then the resulting stream is sent to the parser.
 //
-// $Date: 2000/03/27 09:33:43 $
-// $Author: Andreas Adelmann $
+// Copyright (c) 2008 - 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
 //
-// ------------------------------------------------------------------------
+// All rights reserved
+//
+// This file is part of OPAL.
+//
+// OPAL is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// You should have received a copy of the GNU General Public License
+// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
+//
+#ifndef CLASSIC_MacroCmd_HH
+#define CLASSIC_MacroCmd_HH
 
 #include "OpalParser/Macro.h"
 #include "OpalParser/MacroStream.h"
 #include "MemoryManagement/Pointer.h"
 #include <iosfwd>
-
+#include <string>
 
 // Class MacroCmd
 // ------------------------------------------------------------------------
-/// Encapsulate the buffer for the ``archetypes'' of all macros.
-//  The macro is stored as a MacroStream.  For execution, first the
-//  parameters are replaced, then the resulting stream is sent to the parser.
 
 class MacroCmd: public Macro {
 
@@ -65,4 +67,4 @@ private:
     const Parser *itsParser;
 };
 
-#endif // CLASSIC_MacroCmd_HH
+#endif // CLASSIC_MacroCmd_HH
\ No newline at end of file
-- 
GitLab