Sprite/asset pipeline:
- Linker::link_with_assets() places sprite CHR data in ROM at correct tile
- assets::resolve_sprites() walks Program for inline sprite bytes
- CodeGen::with_sprites() maps sprite names to tile indices
- gen_draw() uses correct tile index from sprite declarations
- main.rs wires the full resolution pipeline
Shift-assign operators (<<= and >>=):
- AssignOp::ShiftLeftAssign and ShiftRightAssign variants
- Parser handles in both statement and array index contexts
- Codegen emits ASL A / LSR A
- IR lowering maps to ShiftLeft/ShiftRight ops
Unreachable state warning (W0104):
- BFS from start state finds reachable states via transitions
- States not reached produce W0104 warning
Error polish helpers:
- suggest_var_name() for "did you mean" suggestions
- emit_undefined_var() for E0502 with typo hints
- Used by analyzer for better diagnostics
242 tests pass, clippy clean.
https://claude.ai/code/session_01W6eQFStA66EuMKHUFo2rx3
Issues found by systematic review of all compiler modules.
Each fix includes a regression test.
Parser fixes:
- Add EOF checks to function call arg parsing loops (lines 984, 1269)
to prevent infinite loops on unterminated call expressions
- Fix span end positions: use .end instead of .start for 9 declaration
span computations (var, const, fun, state, bank, sprite, palette,
background, block)
- Add missing compound assignment operators (&= |= ^=) to
parse_assign_op() for array element assignments
Codegen fix:
- Fix NOT operator: old code used EOR #$FF + AND #$01 which produced
wrong results for non-boolean inputs (e.g., NOT 0x42 returned 1
instead of 0). New code uses BEQ/branch to properly map any nonzero
value to 0 and zero to 1.
Assembler fixes:
- Add branch offset range validation: assert offset is in -128..127
range instead of silently wrapping on overflow
- Panic on unresolved labels instead of silently leaving placeholder
0x00 bytes in the output
Verified non-issues (reviewer false positives):
- NMI P register: 6502 hardware pushes P automatically on NMI entry;
RTI restores it. PHP/PLP not needed.
- Controller read buffer: 8 iterations of LSR+ROL fully replace all
8 bits, so prior contents don't matter.
- advance() panic: tokens always has at least Eof from lexer.
4 new regression tests, 225 total.
https://claude.ai/code/session_01W6eQFStA66EuMKHUFo2rx3
README: project overview, quick start, feature list, example table
LICENSE: MIT
4 new examples covering all language features:
- arrays_and_functions: arrays, while loops, inline/regular functions
- state_machine: multi-state flow with on enter/exit handlers
- sprites_and_palettes: inline CHR data, palette switching, scroll, cast
- mmc1_banked: MMC1 mapper, bank declarations, software multiply
Parser fix: draw statement keyword-arg parsing now checks for ':'
lookahead before consuming an identifier, preventing it from eating
the next statement as a keyword argument (e.g., `i += 1` after a draw).
https://claude.ai/code/session_01W6eQFStA66EuMKHUFo2rx3