1
0
Fork 0
mirror of https://github.com/imjasonh/nescript synced 2026-07-08 08:55:38 +00:00
nescript/docs
Claude 155a0e7096
analyzer: reject functions with more than 4 parameters (E0506)
The v0.1 calling convention passes parameters through four fixed
zero-page slots ($04-$07). Functions declared with 5+ parameters
were silently dropped past the 4th, producing a runtime miscompile
with no compile-time signal — a trap I hit while building the
War example (arm_fly took 6 params and silently corrupted fly_card
and fly_face_up).

Add E0506 to the analyzer so the over-arity case becomes a clear
compile-time error pointing at the user's `fun` declaration with
guidance toward globals or splitting. New tests cover both the 5-
param rejection and the 4-param accept boundary.

Documented in examples/war/COMPILER_BUGS.md §1, language-guide.md
"Restrictions" section, and the error code table.

https://claude.ai/code/session_0143dTgh3UeRrtfHgQwzcv5z
2026-04-15 15:28:03 +00:00
..
architecture.md
future-work.md docs/future-work: prune items shipped on this branch 2026-04-15 03:31:58 +00:00
language-guide.md analyzer: reject functions with more than 4 parameters (E0506) 2026-04-15 15:28:03 +00:00
nes-reference.md
platformer.gif