class Prism::BeginNode
^^^^^
end
foo
begin
Represents a begin statement.
def self.type
def self.type :begin_node end
def ===(other)
Implements case-equality for the node. This is effectively == but without
def ===(other) other.is_a?(BeginNode) && (begin_keyword_loc.nil? == other.begin_keyword_loc.nil?) && (statements === other.statements) && (rescue_clause === other.rescue_clause) && (else_clause === other.else_clause) && (ensure_clause === other.ensure_clause) && (end_keyword_loc.nil? == other.end_keyword_loc.nil?) end
def accept(visitor)
def accept(visitor) visitor.visit_begin_node(self) end
def begin_keyword
def begin_keyword begin_keyword_loc&.slice end
def begin_keyword_loc
begin x end
Represents the location of the `begin` keyword.
def begin_keyword_loc location = @begin_keyword_loc case location when nil nil when Location location else @begin_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF) end end
def child_nodes
def child_nodes [statements, rescue_clause, else_clause, ensure_clause] end
def comment_targets
def comment_targets [*begin_keyword_loc, *statements, *rescue_clause, *else_clause, *ensure_clause, *end_keyword_loc] #: Array[Prism::node | Location] end
def compact_child_nodes
def compact_child_nodes compact = [] #: Array[Prism::node] compact << statements if statements compact << rescue_clause if rescue_clause compact << else_clause if else_clause compact << ensure_clause if ensure_clause compact end
def copy(node_id: self.node_id, location: self.location, flags: self.flags, begin_keyword_loc: self.begin_keyword_loc, statements: self.statements, rescue_clause: self.rescue_clause, else_clause: self.else_clause, ensure_clause: self.ensure_clause, end_keyword_loc: self.end_keyword_loc)
def copy(node_id: self.node_id, location: self.location, flags: self.flags, begin_keyword_loc: self.begin_keyword_loc, statements: self.statements, rescue_clause: self.rescue_clause, else_clause: self.else_clause, ensure_clause: self.ensure_clause, end_keyword_loc: self.end_keyword_loc) BeginNode.new(source, node_id, location, flags, begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc) end
def deconstruct_keys(keys)
def deconstruct_keys(keys) { node_id: node_id, location: location, begin_keyword_loc: begin_keyword_loc, statements: statements, rescue_clause: rescue_clause, else_clause: else_clause, ensure_clause: ensure_clause, end_keyword_loc: end_keyword_loc } end
def each_child_node
def each_child_node return to_enum(:each_child_node) unless block_given? yield statements if statements yield rescue_clause if rescue_clause yield else_clause if else_clause yield ensure_clause if ensure_clause end
def end_keyword
def end_keyword end_keyword_loc&.slice end
def end_keyword_loc
begin x end
Represents the location of the `end` keyword.
def end_keyword_loc location = @end_keyword_loc case location when nil nil when Location location else @end_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF) end end
def initialize(source, node_id, location, flags, begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc)
def initialize(source, node_id, location, flags, begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc) @source = source @node_id = node_id @location = location @flags = flags @begin_keyword_loc = begin_keyword_loc @statements = statements @rescue_clause = rescue_clause @else_clause = else_clause @ensure_clause = ensure_clause @end_keyword_loc = end_keyword_loc end
def inspect
def inspect InspectVisitor.compose(self) end
def newline_flag!(lines) # :nodoc:
def newline_flag!(lines) # :nodoc: # Never mark BeginNode with a newline flag, mark children instead. end
def save_begin_keyword_loc(repository)
Save the begin_keyword_loc location using the given saved source so that
def save_begin_keyword_loc(repository) repository.enter(node_id, :begin_keyword_loc) unless @begin_keyword_loc.nil? end
def save_end_keyword_loc(repository)
Save the end_keyword_loc location using the given saved source so that
def save_end_keyword_loc(repository) repository.enter(node_id, :end_keyword_loc) unless @end_keyword_loc.nil? end
def type
def type :begin_node end