mruby-compiler: allow compound statement in tLPAREN_ARG

Change the grammar rule for tLPAREN_ARG from accepting only a
single stmt to accepting compstmt. This allows compound
statements with semicolons inside parenthesized arguments when
the parenthesis is preceded by a space, e.g., `p (f1; f2)`.

This matches the behavior of CRuby 3.3+.

Fixes #6766.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2026-03-30 07:06:30 +09:00
parent 801eefeab6
commit 919cbd8fea
2 changed files with 1870 additions and 1838 deletions
+1 -1
View File
@@ -3260,7 +3260,7 @@ primary : literal
$<stack>$ = p->cmdarg_stack;
p->cmdarg_stack = 0;
}
stmt {p->lstate = EXPR_ENDARG;} rparen
compstmt {p->lstate = EXPR_ENDARG;} rparen
{
p->cmdarg_stack = $<stack>2;
$$ = $3;
File diff suppressed because it is too large Load Diff