Class: ORB::AST::BlockNode

Inherits:
AbstractNode show all
Defined in:
lib/orb/ast/block_node.rb

Constant Summary

Constants inherited from AbstractNode

AbstractNode::EMPTY_ARRAY

Instance Attribute Summary

Attributes inherited from AbstractNode

#attributes, #children, #errors

Instance Method Summary collapse

Methods inherited from AbstractNode

#==, #add_child, #add_error

Constructor Details

#initialize(token) ⇒ BlockNode

Returns a new instance of BlockNode.



6
7
8
9
10
# File 'lib/orb/ast/block_node.rb', line 6

def initialize(token)
  super
  @name = token.value
  @meta = token.meta
end

Instance Method Details

#expressionObject



16
17
18
# File 'lib/orb/ast/block_node.rb', line 16

def expression
  @meta.fetch(:expression, false)
end

#nameObject



12
13
14
# File 'lib/orb/ast/block_node.rb', line 12

def name
  @name.to_sym
end

#render(_context) ⇒ Object

TODO: Support render to text for different block types



21
22
23
# File 'lib/orb/ast/block_node.rb', line 21

def render(_context)
  raise "BlockNode#render not implemented."
end