Class: Citrus::Block

Inherits:
Object
  • Object
show all
Defined in:
lib/citrus/compiler/block.rb

Instance Method Summary collapse

Constructor Details

#initialize(mod, function, parent) ⇒ Block

Returns a new instance of Block.



4
5
6
7
8
9
# File 'lib/citrus/compiler/block.rb', line 4

def initialize(mod, function, parent)
  @module = mod
  @function = function
  @parent = parent
  build_block { |g| yield g if block_given? }
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(symbol, *args, &block) ⇒ Object



20
21
22
# File 'lib/citrus/compiler/block.rb', line 20

def method_missing(symbol, *args, &block)
  @generator.send(symbol, *args, &block)
end

Instance Method Details

#basic_blockObject Also known as: bb



11
12
13
# File 'lib/citrus/compiler/block.rb', line 11

def basic_block
  return @generator.basic_block
end

#localsObject



16
17
18
# File 'lib/citrus/compiler/block.rb', line 16

def locals
  return @generator.locals
end