Class: Prism::RetryNode

Inherits:
PrismNode
  • Object
show all
Defined in:
lib/prism/node.rb,
ext/prism/api_node.c

Overview

Represents the use of the retry keyword.

retry
^^^^^

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, node_id, location, flags) ⇒ RetryNode

Initialize a new RetryNode node.



17179
17180
17181
17182
17183
17184
# File 'lib/prism/node.rb', line 17179

def initialize(source, node_id, location, flags)
  @source = source
  @node_id = node_id
  @location = location
  @flags = flags
end

Class Method Details

.typeObject

Return a symbol representation of this node type. See Node::type.



17236
17237
17238
# File 'lib/prism/node.rb', line 17236

def self.type
  :retry_node
end

Instance Method Details

#===(other) ⇒ Object

Implements case-equality for the node. This is effectively == but without comparing the value of locations. Locations are checked only for presence.



17242
17243
17244
# File 'lib/prism/node.rb', line 17242

def ===(other)
  other.is_a?(RetryNode)
end

#accept(visitor) ⇒ Object

def accept: (Visitor visitor) -> void



17187
17188
17189
# File 'lib/prism/node.rb', line 17187

def accept(visitor)
  visitor.visit_retry_node(self)
end

#child_nodesObject Also known as: deconstruct

def child_nodes: () -> Array



17192
17193
17194
# File 'lib/prism/node.rb', line 17192

def child_nodes
  []
end

#comment_targetsObject

def comment_targets: () -> Array[Node | Location]



17208
17209
17210
# File 'lib/prism/node.rb', line 17208

def comment_targets
  [] #: Array[Prism::node | Location]
end

#compact_child_nodesObject

def compact_child_nodes: () -> Array



17203
17204
17205
# File 'lib/prism/node.rb', line 17203

def compact_child_nodes
  []
end

#copy(node_id: self.node_id, location: self.location, flags: self.flags) ⇒ Object

def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> RetryNode



17213
17214
17215
# File 'lib/prism/node.rb', line 17213

def copy(node_id: self.node_id, location: self.location, flags: self.flags)
  RetryNode.new(source, node_id, location, flags)
end

#deconstruct_keys(keys) ⇒ Object

def deconstruct_keys: (Array keys) -> { node_id: Integer, location: Location }



17221
17222
17223
# File 'lib/prism/node.rb', line 17221

def deconstruct_keys(keys)
  { node_id: node_id, location: location }
end

#each_child_nodeObject

def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator



17197
17198
17199
17200
# File 'lib/prism/node.rb', line 17197

def each_child_node
  return to_enum(:each_child_node) unless block_given?

end

#inspectObject

def inspect -> String



17226
17227
17228
# File 'lib/prism/node.rb', line 17226

def inspect
  InspectVisitor.compose(self)
end

#typeObject

Return a symbol representation of this node type. See ‘Node#type`.



17231
17232
17233
# File 'lib/prism/node.rb', line 17231

def type
  :retry_node
end