Class: IV::Phonic::AST::CaseClause

Inherits:
Node
  • Object
show all
Defined in:
lib/iv/phonic/ast.rb

Instance Method Summary collapse

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