Class: SyntaxTree::Retry
- Inherits:
-
Node
- Object
- Node
- SyntaxTree::Retry
show all
- Defined in:
- lib/syntax_tree/node.rb
Overview
Retry represents the use of the retry keyword.
retry
Instance Attribute Summary collapse
Attributes inherited from Node
#location
Instance Method Summary
collapse
Methods inherited from Node
#construct_keys, #pretty_print, #to_json
Constructor Details
#initialize(location:) ⇒ Retry
9525
9526
9527
9528
|
# File 'lib/syntax_tree/node.rb', line 9525
def initialize(location:)
@location = location
= []
end
|
Instance Attribute Details
- Array[ Comment | EmbDoc ]
-
the comments attached to this node
9523
9524
9525
|
# File 'lib/syntax_tree/node.rb', line 9523
def
end
|
Instance Method Details
#===(other) ⇒ Object
9555
9556
9557
|
# File 'lib/syntax_tree/node.rb', line 9555
def ===(other)
other.is_a?(Retry)
end
|
#accept(visitor) ⇒ Object
9530
9531
9532
|
# File 'lib/syntax_tree/node.rb', line 9530
def accept(visitor)
visitor.visit_retry(self)
end
|
#child_nodes ⇒ Object
Also known as:
deconstruct
9534
9535
9536
|
# File 'lib/syntax_tree/node.rb', line 9534
def child_nodes
[]
end
|
#copy(location: nil) ⇒ Object
9538
9539
9540
9541
9542
9543
|
# File 'lib/syntax_tree/node.rb', line 9538
def copy(location: nil)
node = Retry.new(location: location || self.location)
node..concat(.map(&:copy))
node
end
|
#deconstruct_keys(_keys) ⇒ Object
9547
9548
9549
|
# File 'lib/syntax_tree/node.rb', line 9547
def deconstruct_keys(_keys)
{ location: location, comments: }
end
|
9551
9552
9553
|
# File 'lib/syntax_tree/node.rb', line 9551
def format(q)
q.text("retry")
end
|