[Mumps2Py:] [181] parsing delimiter fixes, and took out a tab in the parseError error message. |
[ Thread Index |
Date Index
| More lists.mumps2py.org/discuss Archives
]
Revision: 181
Author: pgallot
Date: 2008-03-19 21:25:13 +0100 (Wed, 19 Mar 2008)
Log Message:
-----------
parsing delimiter fixes, and took out a tab in the parseError error message.
Modified Paths:
--------------
trunk/mumps2py/mumps2tok.py
Modified: trunk/mumps2py/mumps2tok.py
===================================================================
--- trunk/mumps2py/mumps2tok.py 2008-03-18 04:35:06 UTC (rev 180)
+++ trunk/mumps2py/mumps2tok.py 2008-03-19 20:25:13 UTC (rev 181)
@@ -36,11 +36,11 @@
def error_msg(self):
""" returns a formated string containing information about the error"""
if self.pos:
- errormsg = "\nError: %d:%d : %s\n\t%s\n[%s]" % \
+ errormsg = "\nError: %d:%d : %s\n%s\n[%s]" % \
(self.lineno, self.pos, self.dscr, self.line,
self.line[self.pos:])
else:
- errormsg = "\nError: %d: %s\n\t%s" % \
+ errormsg = "\nError: %d: %s\n%s" % \
(self.lineno, self.dscr, self.line)
return errormsg
@@ -529,12 +529,12 @@
var["var_names"] = var_list
pos += 1
else:
- varname = parse_expr(line, pos, r"([,= ]|\s*$)")
+ varname = parse_expr(line, pos, r"([,=]|\s*$|\s)")
var["varname"] = varname
pos = varname.end
if not mterminated.match(line, pos) and line[pos] == '=':
pos += 1
- val = parse_expr(line, pos, r"([ ,]|\s*$)")
+ val = parse_expr(line, pos, r"([;,]|\s*$|\s)")
var["val"] = val
pos = val.end
else: # note: this is somewhat of an assumption, but...
@@ -1071,9 +1071,8 @@
parse_routine(a_module)
try:
- #mods = parse_for_routines("../testfiles/vista.m2p", "./out")
mods = parse_for_routines("../testfiles/fm22.m2p", "./out")
- #mods = parse_for_routines("../testfiles/famo.m2p", "./out")
+ #mods = parse_for_routines("../testfiles/problem_lines.mps", "./out")
#parsemodule(mods,"%YGE4")
for the_module in mods:
print the_module.mod_name