Class: Ikra::AST::BoolLiteralNode
- 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:) ⇒ BoolLiteralNode
constructor
A new instance of BoolLiteralNode.
- #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:) ⇒ BoolLiteralNode
Returns a new instance of BoolLiteralNode.
400 401 402 |
# File 'lib/ast/nodes.rb', line 400 def initialize(value:) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
398 399 400 |
# File 'lib/ast/nodes.rb', line 398 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
104 105 106 |
# File 'lib/ast/visitor.rb', line 104 def accept(visitor) visitor.visit_bool_node(self) end |
#clone ⇒ Object
404 405 406 |
# File 'lib/ast/nodes.rb', line 404 def clone return BoolLiteralNode.new(value: @value) end |
#to_s ⇒ Object
96 97 98 |
# File 'lib/ast/printer.rb', line 96 def to_s return "<#{value.to_s}>" end |