Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Prism::InspectVisitor#visit_lambda_node
visit_lambda_node(node)
lib/prism/inspect_visitor.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/prism/inspect_visitor.rb, line 1496
def visit_lambda_node(node)
commands << [inspect_node("LambdaNode", node), indent]
flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
commands << ["├── flags: #{flags.empty? ? "∅" : flags.join(", ")}\n", indent]
commands << ["├── locals: #{node.locals.inspect}\n", indent]
commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
commands << ["├── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
if (parameters = node.parameters).nil?
commands << ["├── parameters: ∅\n", indent]
else
commands << ["├── parameters:\n", indent]
commands << [parameters, "#{indent}│ "]
end
if (body = node.body).nil?
commands << ["└── body: ∅\n", indent]
else
commands << ["└── body:\n", indent]
commands << [body, "#{indent} "]
end
end
Inspect a LambdaNode node.