Skip to content

Commit ca723f9

Browse files
matztsahara
authored andcommitted
should ignore block to next, break, etc. fix mruby#3039
1 parent 0180d03 commit ca723f9

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/parse.y

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2509,6 +2509,15 @@ block_call : command do_block
25092509
if ($1->car == (node*)NODE_YIELD) {
25102510
yyerror(p, "block given to yield");
25112511
}
2512+
else if ($1->car == (node*)NODE_NEXT) {
2513+
yyerror(p, "block given to next");
2514+
}
2515+
else if ($1->car == (node*)NODE_BREAK) {
2516+
yyerror(p, "block given to break");
2517+
}
2518+
else if ($1->car == (node*)NODE_RETURN) {
2519+
yyerror(p, "block given to return");
2520+
}
25122521
else {
25132522
call_with_block(p, $1, $2);
25142523
}

0 commit comments

Comments
 (0)