Class: IV::Phonic::AST::SwitchStatement
- Defined in:
- lib/iv/phonic/ast.rb
Instance Method Summary collapse
-
#initialize(parent, stmt) ⇒ SwitchStatement
constructor
A new instance of SwitchStatement.
Methods inherited from Statement
Methods inherited from Node
#begin_position, #end_position, #program, #source
Constructor Details
#initialize(parent, stmt) ⇒ SwitchStatement
Returns a new instance of SwitchStatement.
243 244 245 246 247 |
# File 'lib/iv/phonic/ast.rb', line 243 def initialize parent, stmt super parent, stmt @cond = Expression.as self, stmt[:cond] @clauses = stmt[:clauses].map{|clause| CaseClause.new self, clause } end |