[Mumps2Py:] [128] fixed some lint-removal breakage. |
[ Thread Index |
Date Index
| More lists.mumps2py.org/discuss Archives
]
Revision: 128
Author: pgallot
Date: 2008-02-24 23:56:50 +0000 (Sun, 24 Feb 2008)
Log Message:
-----------
fixed some lint-removal breakage.
Modified Paths:
--------------
trunk/mumps2py/mumps2tok.py
Modified: trunk/mumps2py/mumps2tok.py
===================================================================
--- trunk/mumps2py/mumps2tok.py 2008-02-24 23:55:26 UTC (rev 127)
+++ trunk/mumps2py/mumps2tok.py 2008-02-24 23:56:50 UTC (rev 128)
@@ -332,8 +332,8 @@
(MUMPS_RE_DICT["subexpr"], consume_sub_expr, "subexpr")]
pos = startpos
- token = Token(EXPR, pos)
- token.expr_list = []
+ expr_token = Token(EXPR, pos)
+ expr_token.expr_list = []
mterminator = re.compile(terminator)
while not mterminator.match(line, pos):
@@ -344,23 +344,22 @@
pattern_match = True
sub_token, end_pos = consume(re_match)
pos = sub_token.end = end_pos
- token.expr_list.append(sub_token)
+ expr_token.expr_list.append(sub_token)
break
if not pattern_match:
raise ParseError(line, "No Pattern match", pos )
- token.end = pos
- if len(token.expr_list) == 2:
- right_tok = token.expr_list.pop()
- left_tok = token.expr_list.pop()
+ expr_token.end = pos
+ if len(expr_token.expr_list) == 2:
+ left_tok, right_tok = expr_token.expr_list[:2]
if right_tok.is_num() and left_tok.toktype in (OPADD, OPSUB):
if left_tok.toktype == OPSUB:
right_tok.val = "-" + right_tok.val
- token = right_tok
- elif len(token.expr_list) == 1:
- token = token.expr_list[0]
- return token
+ expr_token = right_tok
+ elif len(expr_token.expr_list) == 1:
+ expr_token = expr_token.expr_list[0]
+ return expr_token
def parse_command(line, startpos=0):
"""parses all known Mumps commands"""