aboutsummaryrefslogtreecommitdiffstats
path: root/format.py
diff options
context:
space:
mode:
authors-ol <s+removethis@s-ol.nu>2021-05-23 09:15:25 +0000
committers-ol <s+removethis@s-ol.nu>2021-05-23 09:15:25 +0000
commitf89982437be8154a9c77527faee2459f0957a450 (patch)
treee977ecdfc81f96d36a5432e5430cfc405e4ce02b /format.py
parentlog offending line when errors occur, across all stages (diff)
downloadsubv-f89982437be8154a9c77527faee2459f0957a450.tar.gz
subv-f89982437be8154a9c77527faee2459f0957a450.zip
revert to code detection by segment
Diffstat (limited to 'format.py')
-rwxr-xr-xformat.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/format.py b/format.py
index aa6c8ba..7798589 100755
--- a/format.py
+++ b/format.py
@@ -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']