Class: IV::Phonic::AST::IfStatement
- Defined in:
- lib/iv/phonic/ast.rb
Instance Method Summary collapse
-
#initialize(parent, stmt) ⇒ IfStatement
constructor
A new instance of IfStatement.
Methods inherited from Statement
Methods inherited from Node
#begin_position, #end_position, #program, #source
Constructor Details
#initialize(parent, stmt) ⇒ IfStatement
Returns a new instance of IfStatement.
134 135 136 137 138 139 140 141 142 143 |
# File 'lib/iv/phonic/ast.rb', line 134 def initialize parent, stmt super parent, stmt @cond = Expression.as self, stmt[:cond] @then = Statement.as self, stmt[:then] if stmt[:else] @else = Statement.as self, stmt[:else] else @else = nil end end |