lib/parser/ruby23.y in parser-2.7.1.3 vs lib/parser/ruby23.y in parser-2.7.1.4

- old
+ new

@@ -1026,15 +1026,19 @@ { begin_t, args, body, end_t = val[1] result = @builder.block(val[0], begin_t, args, body, end_t) } - | tLAMBDA lambda + | tLAMBDA { + @context.push(:lambda) + } + lambda + { lambda_call = @builder.call_lambda(val[0]) - args, (begin_t, body, end_t) = val[1] + args, (begin_t, body, end_t) = val[2] result = @builder.block(lambda_call, begin_t, args, body, end_t) } | kIF expr_value then compstmt if_tail kEND { @@ -1144,10 +1148,11 @@ } | kMODULE cpath { @static_env.extend_static @lexer.push_cmdarg + @context.push(:module) } bodystmt kEND { unless @context.module_definition_allowed? diagnostic :error, :module_in_def, nil, val[0] @@ -1156,10 +1161,11 @@ result = @builder.def_module(val[0], val[1], val[3], val[4]) @lexer.pop_cmdarg @static_env.unextend + @context.pop } | kDEF fname { @static_env.extend_static @lexer.push_cmdarg @@ -1468,9 +1474,10 @@ } f_larglist { result = @lexer.cmdarg.dup @lexer.cmdarg.clear + @context.pop } lambda_body { @lexer.cmdarg = val[2] @lexer.cmdarg.lexpop