class YARP::NumberedReferenceReadNode
Represents reading a numbered reference to a capture in the previous match.
$1 ^^
Attributes
number[R]
attr_reader number: Integer
Public Class Methods
new(number, location)
click to toggle source
def initialize: (number: Integer
, location: Location) -> void
# File lib/yarp/node.rb, line 8627 def initialize(number, location) @number = number @location = location end
Public Instance Methods
accept(visitor)
click to toggle source
def accept: (visitor: Visitor
) -> void
# File lib/yarp/node.rb, line 8633 def accept(visitor) visitor.visit_numbered_reference_read_node(self) end
child_nodes()
click to toggle source
def child_nodes
: () -> Array[nil | Node]
# File lib/yarp/node.rb, line 8638 def child_nodes [] end
Also aliased as: deconstruct
comment_targets()
click to toggle source
def comment_targets
: () -> Array[Node | Location]
# File lib/yarp/node.rb, line 8648 def comment_targets [] end
compact_child_nodes()
click to toggle source
def compact_child_nodes
: () -> Array
# File lib/yarp/node.rb, line 8643 def compact_child_nodes [] end
copy(**params)
click to toggle source
def copy: (**params) -> NumberedReferenceReadNode
# File lib/yarp/node.rb, line 8653 def copy(**params) NumberedReferenceReadNode.new( params.fetch(:number) { number }, params.fetch(:location) { location }, ) end
deconstruct_keys(keys)
click to toggle source
def deconstruct_keys
: (keys: Array) -> Hash[Symbol, nil | Node | Array | String
| Token | Array | Location]
# File lib/yarp/node.rb, line 8664 def deconstruct_keys(keys) { number: number, location: location } end
inspect(inspector = NodeInspector.new)
click to toggle source
# File lib/yarp/node.rb, line 8668 def inspect(inspector = NodeInspector.new) inspector << inspector.header(self) inspector << "└── number: #{number.inspect}\n" inspector.to_str end