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, #end_char, #pretty_print, #start_char, #to_json, #to_mermaid
Constructor Details
#initialize(location:) ⇒ Redo
Returns a new instance of Redo.
9007
9008
9009
9010
|
# File 'lib/syntax_tree/node.rb', line 9007
def initialize(location:)
@location = location
@comments = []
end
|
Instance Attribute Details
- Array[ Comment | EmbDoc ]
-
the comments attached to this node
9005
9006
9007
|
# File 'lib/syntax_tree/node.rb', line 9005
def
@comments
end
|
Instance Method Details
#===(other) ⇒ Object
9037
9038
9039
|
# File 'lib/syntax_tree/node.rb', line 9037
def ===(other)
other.is_a?(Redo)
end
|
#accept(visitor) ⇒ Object
9012
9013
9014
|
# File 'lib/syntax_tree/node.rb', line 9012
def accept(visitor)
visitor.visit_redo(self)
end
|
#child_nodes ⇒ Object
Also known as:
deconstruct
9016
9017
9018
|
# File 'lib/syntax_tree/node.rb', line 9016
def child_nodes
[]
end
|
#copy(location: nil) ⇒ Object
9020
9021
9022
9023
9024
9025
|
# File 'lib/syntax_tree/node.rb', line 9020
def copy(location: nil)
node = Redo.new(location: location || self.location)
node..concat(.map(&:copy))
node
end
|
#deconstruct_keys(_keys) ⇒ Object
9029
9030
9031
|
# File 'lib/syntax_tree/node.rb', line 9029
def deconstruct_keys(_keys)
{ location: location, comments: }
end
|
9033
9034
9035
|
# File 'lib/syntax_tree/node.rb', line 9033
def format(q)
q.text("redo")
end
|