Skip to content

Commit 7a0960b

Browse files
tools: strip whitespace in gen-postmortem-metadata.py
[email protected] Review URL: https://codereview.chromium.org/221513002 Patch from Ben Noordhuis <[email protected]>. git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@20436 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
1 parent a74c8b8 commit 7a0960b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tools/gen-postmortem-metadata.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,13 @@ def load_fields():
434434
# Emit a block of constants.
435435
#
436436
def emit_set(out, consts):
437-
for ii in range(0, len(consts)):
438-
out.write('int v8dbg_%s = %s;\n' %
439-
(consts[ii]['name'], consts[ii]['value']));
437+
# Fix up overzealous parses. This could be done inside the
438+
# parsers but as there are several, it's easiest to do it here.
439+
ws = re.compile('\s+')
440+
for const in consts:
441+
name = ws.sub('', const['name'])
442+
value = ws.sub('', str(const['value'])) # Can be a number.
443+
out.write('int v8dbg_%s = %s;\n' % (name, value))
440444
out.write('\n');
441445

442446
#

0 commit comments

Comments
 (0)