Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
PrettyPrint#group_sub
() { () -> untyped } -> untyped
group_sub() { || ... }
lib/prettyprint.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/prettyprint.rb, line 263
def group_sub
group = Group.new(@group_stack.last.depth + 1)
@group_stack.push group
@group_queue.enq group
begin
yield
ensure
@group_stack.pop
if group.breakables.empty?
@group_queue.delete group
end
end
end
Takes a block and queues a new group that is indented 1 level further.