Class: Ikra::AST::ReturnNode
- Defined in:
- lib/ast/nodes.rb,
lib/ast/printer.rb,
lib/ast/visitor.rb
Constant Summary
Constants inherited from TreeNode
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #clone ⇒ Object
-
#initialize(value:) ⇒ ReturnNode
constructor
A new instance of ReturnNode.
- #to_s ⇒ Object
Methods inherited from TreeNode
#==, #enclosing_class, #find_behavior_node, #get_type, #is_begin_node?, #merge_union_type, #register_type_change, #replace, #replace_child, #symbol_table
Methods inherited from Node
Constructor Details
#initialize(value:) ⇒ ReturnNode
Returns a new instance of ReturnNode.
687 688 689 690 691 |
# File 'lib/ast/nodes.rb', line 687 def initialize(value:) @value = value value.parent = self end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
685 686 687 |
# File 'lib/ast/nodes.rb', line 685 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
188 189 190 |
# File 'lib/ast/visitor.rb', line 188 def accept(visitor) return visitor.visit_return_node(self) end |
#clone ⇒ Object
693 694 695 |
# File 'lib/ast/nodes.rb', line 693 def clone return ReturnNode.new(value: value.clone) end |
#to_s ⇒ Object
192 193 194 |
# File 'lib/ast/printer.rb', line 192 def to_s return "[ReturnNode: #{value.to_s}]" end |