Skip to content

Commit 919cbd8

Browse files
matzclaude
andcommitted
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>
1 parent 801eefe commit 919cbd8

2 files changed

Lines changed: 1865 additions & 1833 deletions

File tree

mrbgems/mruby-compiler/core/parse.y

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3260,7 +3260,7 @@ primary : literal
32603260
$<stack>$ = p->cmdarg_stack;
32613261
p->cmdarg_stack = 0;
32623262
}
3263-
stmt {p->lstate = EXPR_ENDARG;} rparen
3263+
compstmt {p->lstate = EXPR_ENDARG;} rparen
32643264
{
32653265
p->cmdarg_stack = $<stack>2;
32663266
$$ = $3;

0 commit comments

Comments
 (0)