diff options
| author | s-ol <s+removethis@s-ol.nu> | 2021-05-23 09:15:25 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2021-05-23 09:15:25 +0000 |
| commit | f89982437be8154a9c77527faee2459f0957a450 (patch) | |
| tree | e977ecdfc81f96d36a5432e5430cfc405e4ce02b /format.py | |
| parent | log offending line when errors occur, across all stages (diff) | |
| download | subv-f89982437be8154a9c77527faee2459f0957a450.tar.gz subv-f89982437be8154a9c77527faee2459f0957a450.zip | |
revert to code detection by segment
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'] |
