summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-06-14 13:45:37 +0000
committerGabe Black <gblack@eecs.umich.edu>2007-06-14 13:45:37 +0000
commitd265c9951f79e544a5d5cedbba6810feff812cc7 (patch)
treebaad5c8b772a52d36bbe1da2782244b7bd9ed860 /src
parent6641423a0b3b906a6fd943296d3c9ebbc3918374 (diff)
downloadgem5-d265c9951f79e544a5d5cedbba6810feff812cc7.tar.xz
Fix up param regular expression to not duplicated the escaping \ and to pair up \s correctly.
--HG-- extra : convert_revision : b4b790fb8cfd2a9e28568cf978eca70b1c65806b
Diffstat (limited to 'src')
-rw-r--r--src/arch/micro_asm.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/arch/micro_asm.py b/src/arch/micro_asm.py
index 307c9118b..a8a63e1f8 100644
--- a/src/arch/micro_asm.py
+++ b/src/arch/micro_asm.py
@@ -232,8 +232,15 @@ def t_ANY_ID(t):
# Parameters are a string of text which don't contain an unescaped statement
# statement terminator, ie a newline or semi colon.
def t_params_PARAMS(t):
- r'([^\n;]|((?<=\\)[\n;]))+'
+ r'([^\n;\\]|(\\[\n;\\]))+'
t.lineno += t.value.count('\n')
+ unescapeParamsRE = re.compile(r'(\\[\n;\\])')
+ def unescapeParams(mo):
+ val = mo.group(0)
+ print "About to sub %s for %s" % (val[1], val)
+ return val[1]
+ print "Looking for matches in %s" % t.value
+ t.value = unescapeParamsRE.sub(unescapeParams, t.value)
t.lexer.begin('asm')
return t