[Mumps2Py:] [11] added a couple of methods to ensure that a module is not reparsed unnecessarily , but if it is reparsed, then first empty out the tokenlist.

[ Thread Index | Date Index | More lists.mumps2py.org/discuss Archives ]


Revision: 11
Author:   pgallot
Date:     2008-01-17 18:49:15 +0000 (Thu, 17 Jan 2008)

Log Message:
-----------
added a couple of methods to ensure that a module is not reparsed unnecessarily, but if it is reparsed, then first empty out the tokenlist.

Modified Paths:
--------------
    trunk/mumps2py/mumps_module.py


Modified: trunk/mumps2py/mumps_module.py
===================================================================
--- trunk/mumps2py/mumps_module.py	2008-01-17 18:47:28 UTC (rev 10)
+++ trunk/mumps2py/mumps_module.py	2008-01-17 18:49:15 UTC (rev 11)
@@ -34,6 +34,14 @@
     def __str__(self):
         return "Module %s" % self.mod_name
 
+    def tokenlist_isempty(self):
+        """ returns true if the Token List is empty."""
+        return not len(self.TokenList)
+
+    def empty_tokenlist(self):
+        """ clear out the Token List."""
+        self.TokenList = []
+        
     def add_token(self, newtoken):
         """ add a new token to the token list."""
         self.TokenList.append(newtoken)


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/