Class: Ikra::AST::SourceCodeExprNode
- Defined in:
- lib/ast/nodes.rb,
lib/ast/printer.rb,
lib/ast/visitor.rb
Overview
A synthetic AST node. Contains its string translation directly.
Constant Summary
Constants inherited from TreeNode
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #clone ⇒ Object
-
#initialize(code:) ⇒ SourceCodeExprNode
constructor
A new instance of SourceCodeExprNode.
- #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(code:) ⇒ SourceCodeExprNode
Returns a new instance of SourceCodeExprNode.
297 298 299 |
# File 'lib/ast/nodes.rb', line 297 def initialize(code:) @code = code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
295 296 297 |
# File 'lib/ast/nodes.rb', line 295 def code @code end |
Instance Method Details
#accept(visitor) ⇒ Object
56 57 58 |
# File 'lib/ast/visitor.rb', line 56 def accept(visitor) visitor.visit_source_code_expr_node(self) end |
#clone ⇒ Object
301 302 303 |
# File 'lib/ast/nodes.rb', line 301 def clone return SourceCodeExprNode.new(code: @code) end |
#to_s ⇒ Object
52 53 54 |
# File 'lib/ast/printer.rb', line 52 def to_s return "[SourceCodeExprNode: #{code}]" end |