mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
3e10aaf6c1
added stmts_push(p, stmts, stmt) helper function to properly push statements to NODE_STMTS nodes by accessing the internal stmts field (a cons list). this avoids ugly casts and prevents bugs. fixed incorrect usage in: - top_stmts rule (line 2081): was calling push($1, ...) directly on NODE_STMTS instead of pushing to $1->stmts - bodystmt rule (line 2114): same issue when handling else without rescue - stmts rule (line 2146): simplified to use new helper for consistency the push macro works on cons lists, not NODE_STMTS variable nodes. the new helper encapsulates the cast and provides type-safe access. Co-authored-by: Claude <noreply@anthropic.com>