Class: IV::Phonic::AST::SwitchStatement

Inherits:
Statement show all
Defined in:
lib/iv/phonic/ast.rb

Instance Method Summary collapse

Methods inherited from Statement

as

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