Class: Ikra::AST::SymbolLiteralNode

Inherits:
TreeNode show all
Defined in:
lib/ast/nodes.rb,
lib/ast/printer.rb,
lib/ast/visitor.rb

Constant Summary

Constants inherited from TreeNode

TreeNode::TYPE_INFO_VARS

Instance Attribute Summary collapse

Attributes inherited from Node

#parent

Instance Method Summary collapse

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

#==, #eql?, #hash

Constructor Details

#initialize(value:) ⇒ SymbolLiteralNode

Returns a new instance of SymbolLiteralNode.



416
417
418
# File 'lib/ast/nodes.rb', line 416

def initialize(value:)
    @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



414
415
416
# File 'lib/ast/nodes.rb', line 414

def value
  @value
end

Instance Method Details

#accept(visitor) ⇒ Object



116
117
118
# File 'lib/ast/visitor.rb', line 116

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

#cloneObject



420
421
422
# File 'lib/ast/nodes.rb', line 420

def clone
    return SymbolLiteralNode.new(value: @value)
end

#to_sObject



108
109
110
# File 'lib/ast/printer.rb', line 108

def to_s
    return "<:#{value.to_s}>"
end