Looks like when you have an expression with an implicit begin/end wrapped around them, and the last expression is not on the last line, then it incorrectly identifies where the body is and wraps the wrong thing:
a
def b
c = 1
end
Wraps like this (rescue comes after the line in m, rather than the final end):
begin; $SiB.number_of_captures = Float::INFINITY; $SiB.record_result(1, (a))
def b
$SiB.record_result(3, (c = 1));rescue Exception;line_number = $!.backtrace.grep(/#{__FILE__}/).first[/:\d+/][1..-1].to_i;$SiB.record_exception line_number, $!;$SiB.exitstatus = 1;$SiB.exitstatus = $!.status if $!.kind_of? SystemExit;end
end
Looks like when you have an expression with an implicit begin/end wrapped around them, and the last expression is not on the last line, then it incorrectly identifies where the body is and wraps the wrong thing:
Wraps like this (rescue comes after the line in m, rather than the final end):