[Mumps2Py:] [32] added handling of empty lines.

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


Revision: 32
Author:   pgallot
Date:     2008-01-19 16:24:51 +0000 (Sat, 19 Jan 2008)

Log Message:
-----------
added handling of empty lines.

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


Modified: trunk/mumps2py/tok2python.py
===================================================================
--- trunk/mumps2py/tok2python.py	2008-01-19 16:24:00 UTC (rev 31)
+++ trunk/mumps2py/tok2python.py	2008-01-19 16:24:51 UTC (rev 32)
@@ -69,6 +69,10 @@
     tab_str = "%*c" % (indentlevel*4, '^') 
     return tab_str[:-1]
     
+def translate_emptyline(translation, token):
+    """translate an empty line (a base-case, if you will)."""
+    return "\n"
+
 def translate_comment(translation, token):
     """translate a Mumps comment to Python"""
     return "%s# %s\n" % (tab(token.indentlevel), token.val)
@@ -448,6 +452,7 @@
 
 
 TRANS_FUNC_DICT = {
+    EMPTYLINE: translate_emptyline,
     COMMENT: translate_comment,
     LABEL: translate_label,
     BREAKCMD: translate_break,


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