Class: LIT::Parser::ASTBuilder Private
- Inherits:
-
Object
- Object
- LIT::Parser::ASTBuilder
- Defined in:
- lib/lit/parser/ast_builder.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #build ⇒ Object private
-
#initialize(raw_ast) ⇒ ASTBuilder
constructor
private
A new instance of ASTBuilder.
Constructor Details
#initialize(raw_ast) ⇒ ASTBuilder
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ASTBuilder.
8 9 10 |
# File 'lib/lit/parser/ast_builder.rb', line 8 def initialize(raw_ast) @raw_ast = raw_ast end |
Instance Method Details
#build ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 15 |
# File 'lib/lit/parser/ast_builder.rb', line 12 def build statements = @raw_ast.fetch("statements").map { |raw_stmt| build_statement(raw_stmt) } AST::Program.new(statements) end |