Print debug line when label is invalid
This commit is contained in:
parent
809afce45b
commit
147ac8c8d1
|
@ -26,7 +26,7 @@ def assemble(asm):
|
|||
|
||||
elif line.endswith(':'): # check labels
|
||||
if not re.match(r'^\w+:$', line):
|
||||
raise SyntaxError('invalid label %r' % line[:-1])
|
||||
raise SyntaxError('invalid label\n %d: %s' % (lineno + 1, clean_asm[lineno].lstrip()))
|
||||
|
||||
else: # compile instructions!
|
||||
cur_labels = {lab: lab_offset - offset for (lab, lab_offset) in labels.items()}
|
||||
|
|
Loading…
Reference in New Issue