feat(peephole): reuse shared _asm_parser and harden match guards (topic13 track A) - #43
Conversation
Topic 13 track A follow-up on PR ScratchV-Compiler#39: drop duplicate asm parser, normalize x0/zero aliases, guard short-operand mv swap checks, and add design/dev docs plus regression tests. Co-authored-by: Cursor <cursoragent@cursor.com>
🤖 AI Code Review
📁
|
Summary
scratchv/backend/_asm_parser.pyinsideasm_peephole(remove duplicate parser)redundant mv eliminationswap check (operand length guards)x0/zeroaliases in register constraint matching.globl main+ intent commentsBaseline
Based on PR #39 (
docs/topic13-peephole/d62acdf). This branch includes that tip plus track-A follow-ups. Please review in relation to #39.Test plan
pytest tests/test_asm_peephole*.py→ 88 passed