Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions mypyc/ir/pprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def format_blocks(
lines.append("L%d:%s" % (block.label, handler_msg))
if block in source_to_error:
for error in source_to_error[block]:
lines.append(f" ERR: {error}")
lines.append(f" ERROR: {error}")
ops = block.ops
if (
isinstance(ops[-1], Goto)
Expand All @@ -429,8 +429,11 @@ def format_blocks(
line = " " + op.accept(visitor)
lines.append(line)
if op in source_to_error:
first = len(lines) - 1
# Use emojis to highlight the error
for error in source_to_error[op]:
lines.append(f" ERR: {error}")
lines.append(f" \U0001f446 ERROR: {error}")
lines[first] = " \U0000274c " + lines[first][4:]

if not isinstance(block.ops[-1], (Goto, Branch, Return, Unreachable)):
# Each basic block needs to exit somewhere.
Expand Down
4 changes: 2 additions & 2 deletions mypyc/test/test_ircheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ def test_pprint(self) -> None:
assert formatted == [
"def func_1():",
"L0:",
" goto L1",
" ERR: Invalid control operation target: 1",
" \U0000274c goto L1",
" \U0001f446 ERROR: Invalid control operation target: 1",
]

def test_load_address_declares_register(self) -> None:
Expand Down