diff options
Diffstat (limited to 'format.py')
| -rwxr-xr-x | format.py | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -284,8 +284,8 @@ instr_map = { @subv.with_parsed_lines def format(iter): - for line in iter: - if line['type'] == 'instr': + for segment, line in iter: + if line['type'] == 'instr' and segment == 'code': op = line['instr'][0] assert len(op) == 2, 'instruction without op label: {}'.format(op) @@ -297,9 +297,7 @@ def format(iter): raise ValueError("opcode {} doesn't match label {} (expected {})" .format(op, label, expected)) - formatted = formatter(line['instr']) - formatted[0] = (*formatted[0], label) - line['instr'] = formatted + line['instr'] = formatter(line['instr']) line = yield subv.format(line) else: line = yield line['raw'] |
