[Mumps2Py:] [132] argument indirection handing is easier if the name of the command is passed through , and not just the denatured token for that command.

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


Revision: 132
Author:   pgallot
Date:     2008-02-26 04:50:46 +0000 (Tue, 26 Feb 2008)

Log Message:
-----------
argument indirection handing is easier if the name of the command is passed through, and not just the denatured token for that command.

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


Modified: trunk/mumps2py/mumps2tok.py
===================================================================
--- trunk/mumps2py/mumps2tok.py	2008-02-26 04:47:36 UTC (rev 131)
+++ trunk/mumps2py/mumps2tok.py	2008-02-26 04:50:46 UTC (rev 132)
@@ -845,7 +845,7 @@
         parent_tok.val = val
         parent_tok.end = pos
         
-    def consume_arg_indirection(parent_tok, line, pos):
+    def consume_arg_indirection(cmd_name, parent_tok, line, pos):
         """ parses an argument indirection expression"""
         mterminated = MUMPS_RE_DICT["cmdEnd"]
         if not mterminated.match(line, pos) and line[pos:pos+2] == '@(':
@@ -853,7 +853,8 @@
 
             new_pos = indirection.end
             if mterminated.match(line, new_pos):
-                parent_tok.indirection = indirection
+                parent_tok.name = cmd_name
+                parent_tok.indirect = indirection
                 parent_tok.end = new_pos
                 return True
         return False
@@ -899,7 +900,7 @@
         cmd_token.post_condition(condtok)
         pos = condtok.end + 1
     
-    if not consume_arg_indirection(cmd_token, line, pos):
+    if not consume_arg_indirection(cmd, cmd_token, line, pos):
         if toktype in command_list:
             parse_func = command_list[toktype]
             parse_func(cmd_token, line, pos)


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