Class: YARP::BackReferenceReadNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::BackReferenceReadNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents reading a reference to a field in the previous match.
$'
^^
Instance Method Summary collapse
-
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void.
-
#child_nodes ⇒ Object
(also: #deconstruct)
def child_nodes: () -> Array[nil | Node].
-
#comment_targets ⇒ Object
def comment_targets: () -> Array[Node | Location].
-
#copy(**params) ⇒ Object
def copy: (**params) -> BackReferenceReadNode.
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(location) ⇒ BackReferenceReadNode
constructor
def initialize: (location: Location) -> void.
- #inspect(inspector = NodeInspector.new) ⇒ Object
Constructor Details
#initialize(location) ⇒ BackReferenceReadNode
def initialize: (location: Location) -> void
612 613 614 |
# File 'lib/yarp/node.rb', line 612 def initialize(location) @location = location end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
617 618 619 |
# File 'lib/yarp/node.rb', line 617 def accept(visitor) visitor.visit_back_reference_read_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
622 623 624 |
# File 'lib/yarp/node.rb', line 622 def child_nodes [] end |
#comment_targets ⇒ Object
def comment_targets: () -> Array[Node | Location]
627 628 629 |
# File 'lib/yarp/node.rb', line 627 def comment_targets [] end |
#copy(**params) ⇒ Object
def copy: (**params) -> BackReferenceReadNode
632 633 634 635 636 |
# File 'lib/yarp/node.rb', line 632 def copy(**params) BackReferenceReadNode.new( params.fetch(:location) { location }, ) end |
#deconstruct_keys(keys) ⇒ Object
642 643 644 |
# File 'lib/yarp/node.rb', line 642 def deconstruct_keys(keys) { location: location } end |
#inspect(inspector = NodeInspector.new) ⇒ Object
646 647 648 649 |
# File 'lib/yarp/node.rb', line 646 def inspect(inspector = NodeInspector.new) inspector << inspector.header(self) inspector.to_str end |