Mercurial > hg > truffle
diff mx/outputparser.py @ 7570:2025455e7d80
added collection of compilation speed metric for C1 and C2 to bench command
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 30 Jan 2013 22:39:51 +0100 |
parents | a8bc60aeacb8 |
children | dc3c8df55905 |
line wrap: on
line diff
--- a/mx/outputparser.py Wed Jan 30 22:33:04 2013 +0100 +++ b/mx/outputparser.py Wed Jan 30 22:39:51 2013 +0100 @@ -23,6 +23,8 @@ # # ---------------------------------------------------------------------------------------------------- +import re + class OutputParser: def __init__(self): @@ -62,9 +64,8 @@ valueMaps.append(valueMap) def get_template_value(self, match, template): - if template.startswith('<'): - assert template.endswith('>') - groupName = template[1:-1] + def replace_var(m): + groupName = m.group(1) return match.group(groupName) - else: - return template + + return re.sub(r'<([\w]+)>', replace_var, template)