Class: SyntaxTree::Redo
- Inherits:
-
Node
- Object
- Node
- SyntaxTree::Redo
show all
- Defined in:
- lib/syntax_tree/node.rb
Overview
Redo represents the use of the redo keyword.
redo
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:) ⇒ Redo
8885
8886
8887
8888
|
# File 'lib/syntax_tree/node.rb', line 8885
def initialize(location:)
@location = location
= []
end
|
Instance Attribute Details
- Array[ Comment | EmbDoc ]
-
the comments attached to this node
8883
8884
8885
|
# File 'lib/syntax_tree/node.rb', line 8883
def
end
|
Instance Method Details
#===(other) ⇒ Object
8915
8916
8917
|
# File 'lib/syntax_tree/node.rb', line 8915
def ===(other)
other.is_a?(Redo)
end
|
#accept(visitor) ⇒ Object
8890
8891
8892
|
# File 'lib/syntax_tree/node.rb', line 8890
def accept(visitor)
visitor.visit_redo(self)
end
|
#child_nodes ⇒ Object
Also known as:
deconstruct
8894
8895
8896
|
# File 'lib/syntax_tree/node.rb', line 8894
def child_nodes
[]
end
|
#copy(location: nil) ⇒ Object
8898
8899
8900
8901
8902
8903
|
# File 'lib/syntax_tree/node.rb', line 8898
def copy(location: nil)
node = Redo.new(location: location || self.location)
node..concat(.map(&:copy))
node
end
|
#deconstruct_keys(_keys) ⇒ Object
8907
8908
8909
|
# File 'lib/syntax_tree/node.rb', line 8907
def deconstruct_keys(_keys)
{ location: location, comments: }
end
|
8911
8912
8913
|
# File 'lib/syntax_tree/node.rb', line 8911
def format(q)
q.text("redo")
end
|