Class: IV::Phonic::AST::CaseClause
Instance Method Summary collapse
-
#initialize(parent, clause) ⇒ CaseClause
constructor
A new instance of CaseClause.
Methods inherited from Node
#begin_position, #end_position, #program, #source
Constructor Details
#initialize(parent, clause) ⇒ CaseClause
Returns a new instance of CaseClause.
251 252 253 254 255 256 257 258 259 260 |
# File 'lib/iv/phonic/ast.rb', line 251 def initialize parent, clause super parent, clause @kind = clause[:kind] if @kind == :Case @expr = Expression.as self, clause[:expr] else @expr = nil end @body = clause[:body].map{|stmt| Statement.as self, stmt } end |