Class: Faust2Ruby::AST::CaseBranch

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

Overview

A single branch in a case expression

Instance Attribute Summary collapse

Attributes inherited from Node

#column, #line

Instance Method Summary collapse

Constructor Details

#initialize(pattern, result, **opts) ⇒ CaseBranch

Returns a new instance of CaseBranch.



308
309
310
311
312
# File 'lib/faust2ruby/ast.rb', line 308

def initialize(pattern, result, **opts)
  super(**opts)
  @pattern = pattern  # Can be IntLiteral, Identifier (variable), or Paren
  @result = result
end

Instance Attribute Details

#patternObject (readonly)

Returns the value of attribute pattern.



306
307
308
# File 'lib/faust2ruby/ast.rb', line 306

def pattern
  @pattern
end

#resultObject (readonly)

Returns the value of attribute result.



306
307
308
# File 'lib/faust2ruby/ast.rb', line 306

def result
  @result
end