class Prism::BackReferenceReadNode
Represents reading a reference to a field in the previous match.
$'^^
Attributes
The name of the back-reference variable, including the leading$.
$&# name `:$&`$+# name `:$+`
Public Class Methods
Source
# File lib/prism/node.rb, line 1418definitialize(source,node_id,location,flags,name)@source =source@node_id =node_id@location =location@flags =flags@name =nameend
Initialize a newBackReferenceReadNode node.
Source
# File lib/prism/node.rb, line 1477defself.type:back_reference_read_nodeend
Return a symbol representation of this node type. SeeNode::type.
Public Instance Methods
Source
# File lib/prism/node.rb, line 1483def===(other)other.is_a?(BackReferenceReadNode)&& (name===other.name)end
Implements case-equality for the node. This is effectively == but without comparing the value of locations. Locations are checked only for presence.
Source
# File lib/prism/node.rb, line 1427defaccept(visitor)visitor.visit_back_reference_read_node(self)end
def accept: (Visitor visitor) -> void
Source
# File lib/prism/node.rb, line 1432defchild_nodes []end
defchild_nodes: () ->Array
Also aliased as:deconstruct
Source
# File lib/prism/node.rb, line 1442defcomment_targets []#: Array[Prism::node | Location]end
defcomment_targets: () -> Array[Node | Location]
Source
# File lib/prism/node.rb, line 1437defcompact_child_nodes []end
defcompact_child_nodes: () ->Array
Source
# File lib/prism/node.rb, line 1447defcopy(node_id:self.node_id,location:self.location,flags:self.flags,name:self.name)BackReferenceReadNode.new(source,node_id,location,flags,name)end
def copy: (?node_id:Integer, ?location:Location, ?flags:Integer, ?name:Symbol) ->BackReferenceReadNode
Source
# File lib/prism/node.rb, line 1455defdeconstruct_keys(keys) {node_id:node_id,location:location,name:name }end
defdeconstruct_keys: (Array keys) -> { node_id:Integer, location:Location, name:Symbol }
Source
# File lib/prism/node.rb, line 1467definspectInspectVisitor.compose(self)end
def inspect ->String