Class: IV::Phonic::AST::FunctionLiteral
- Inherits:
-
Literal
- Object
- Node
- Expression
- Literal
- IV::Phonic::AST::FunctionLiteral
- Defined in:
- lib/iv/phonic/ast.rb
Instance Method Summary collapse
-
#initialize(parent, expr) ⇒ FunctionLiteral
constructor
A new instance of FunctionLiteral.
Methods inherited from Expression
Methods inherited from Node
#begin_position, #end_position, #program, #source
Constructor Details
#initialize(parent, expr) ⇒ FunctionLiteral
Returns a new instance of FunctionLiteral.
472 473 474 475 476 477 478 479 480 481 |
# File 'lib/iv/phonic/ast.rb', line 472 def initialize parent, expr super parent, expr if expr[:name] @name = Identifier.new self, expr[:name] else @name = nil end @params = expr[:params].map {|param| Identifier.new self, param } @body = expr[:body].map {|stmt| Statement.as self, stmt } end |