[Mumps2Py:] [33] fixed the quit command parsing and lint removal.

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


Revision: 33
Author:   pgallot
Date:     2008-01-20 14:55:44 +0000 (Sun, 20 Jan 2008)

Log Message:
-----------
fixed the quit command parsing and lint removal.

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


Modified: trunk/mumps2py/mumps2tok.py
===================================================================
--- trunk/mumps2py/mumps2tok.py	2008-01-19 16:24:51 UTC (rev 32)
+++ trunk/mumps2py/mumps2tok.py	2008-01-20 14:55:44 UTC (rev 33)
@@ -668,10 +668,14 @@
 
     def parse_quit(mumps_module, line, pos):
         """parses the Mumps Quit command"""
-        condtok = parse_expr(mumps_module, line, pos)
-        mumps_module.last_token().Condition = condtok
-        mumps_module.end_token(condtok.end)
+        mterminated = MUMPS_RE_DICT["cmdEnd"]
+        if not mterminated.match(line, pos):
+            return_val = parse_expr(mumps_module, line, pos)
+            pos = return_val.end
+            mumps_module.last_token().expr = return_val
 
+        mumps_module.end_token(pos)
+
     def parse_new(mumps_module, line, pos):
         """parses the Mumps New command"""
         new_list = []
@@ -888,8 +892,8 @@
         
         if re_match.group("indents"):
             # count the periods for the nesting level...
-            mumps_module.indent_token(len(re.findall("[.]", \
-                                              line[startpos:re_match.start("cmd")]))) 
+            mumps_module.indent_token( \
+                len(re.findall("[.]", line[startpos:re_match.start("cmd")]))) 
         if line[re_match.end("cmd")] == ':':
             condtok = parse_expr(mumps_module, line, pos)
             mumps_module.post_condition(condtok)


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