From: jkummerow@chromium.org Date: Wed, 2 Apr 2014 13:04:08 +0000 (+0000) Subject: tools: strip whitespace in gen-postmortem-metadata.py X-Git-Tag: upstream/4.7.83~9864 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6b1f05bf352e297578e2959979b73b9ef5702d15;p=platform%2Fupstream%2Fv8.git tools: strip whitespace in gen-postmortem-metadata.py R=jkummerow@chromium.org Review URL: https://codereview.chromium.org/221513002 Patch from Ben Noordhuis . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20436 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/tools/gen-postmortem-metadata.py b/tools/gen-postmortem-metadata.py index 2a42da5..fff2e34 100644 --- a/tools/gen-postmortem-metadata.py +++ b/tools/gen-postmortem-metadata.py @@ -434,9 +434,13 @@ def load_fields(): # Emit a block of constants. # def emit_set(out, consts): - for ii in range(0, len(consts)): - out.write('int v8dbg_%s = %s;\n' % - (consts[ii]['name'], consts[ii]['value'])); + # Fix up overzealous parses. This could be done inside the + # parsers but as there are several, it's easiest to do it here. + ws = re.compile('\s+') + for const in consts: + name = ws.sub('', const['name']) + value = ws.sub('', str(const['value'])) # Can be a number. + out.write('int v8dbg_%s = %s;\n' % (name, value)) out.write('\n'); #