Class: Glyph::DocumentNode
- Inherits:
-
SyntaxNode
- Object
- Hash
- Node
- SyntaxNode
- Glyph::DocumentNode
- Defined in:
- lib/glyph/syntax_node.rb
Overview
The root element of any Glyph Abstract Syntax Tree
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
-
#evaluate(context) ⇒ String
The value of the children node.
Methods inherited from SyntaxNode
#inspect, #parent_macro, #to_s
Methods inherited from Node
#&, #<<, #==, #>>, #ascend, #child, #clear, #descend, #each_child, #find_child, #find_parent, #from, #initialize, #inspect, #root, #to_hash, #to_node
Methods inherited from Hash
Constructor Details
This class inherits a constructor from Node
Instance Method Details
#evaluate(context) ⇒ String
Returns the value of the children node.
48 49 50 51 52 |
# File 'lib/glyph/syntax_node.rb', line 48 def evaluate(context) self[:value] = "" self.children.each {|c| self[:value] << c.evaluate(context) } self[:value] end |