class YARP::YieldNode
^^^^^^^
yield 1
Represents the use of the ‘yield` keyword.
def accept(visitor)
def accept(visitor) visitor.visit_yield_node(self) end
def child_nodes
def child_nodes [arguments] end
def comment_targets
def comment_targets [keyword_loc, *lparen_loc, *arguments, *rparen_loc] end
def copy(**params)
def copy(**params) YieldNode.new( params.fetch(:keyword_loc) { keyword_loc }, params.fetch(:lparen_loc) { lparen_loc }, params.fetch(:arguments) { arguments }, params.fetch(:rparen_loc) { rparen_loc }, params.fetch(:location) { location }, ) end
def deconstruct_keys(keys)
def deconstruct_keys(keys) { keyword_loc: keyword_loc, lparen_loc: lparen_loc, arguments: arguments, rparen_loc: rparen_loc, location: location } end
def initialize(keyword_loc, lparen_loc, arguments, rparen_loc, location)
def initialize(keyword_loc, lparen_loc, arguments, rparen_loc, location) @keyword_loc = keyword_loc @lparen_loc = lparen_loc @arguments = arguments @rparen_loc = rparen_loc @location = location end
def inspect(inspector = NodeInspector.new)
def inspect(inspector = NodeInspector.new) inspector << inspector.header(self) inspector << "├── keyword_loc: #{inspector.location(keyword_loc)}\n" inspector << "├── lparen_loc: #{inspector.location(lparen_loc)}\n" if (arguments = self.arguments).nil? inspector << "├── arguments: ∅\n" else inspector << "├── arguments:\n" inspector << arguments.inspect(inspector.child_inspector("│ ")).delete_prefix(inspector.prefix) end inspector << "└── rparen_loc: #{inspector.location(rparen_loc)}\n" inspector.to_str end
def keyword
def keyword keyword_loc.slice end
def lparen
def lparen lparen_loc&.slice end
def rparen
def rparen rparen_loc&.slice end