Class: Pegarus::Rubinius::Generator

Inherits:
Rubinius::Generator
  • Object
show all
Defined in:
lib/pegarus/rubinius/generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGenerator

Returns a new instance of Generator.



7
8
9
10
11
# File 'lib/pegarus/rubinius/generator.rb', line 7

def initialize
  super
  @fail = new_label
  @done = new_label
end

Instance Attribute Details

#doneObject (readonly)

Returns the value of attribute done.



4
5
6
# File 'lib/pegarus/rubinius/generator.rb', line 4

def done
  @done
end

#failObject

Returns the value of attribute fail.



5
6
7
# File 'lib/pegarus/rubinius/generator.rb', line 5

def fail
  @fail
end

Instance Method Details

#finishObject



33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/pegarus/rubinius/generator.rb', line 33

def finish
  # end
  push_index
  goto done

  # fail
  fail.set!
  push :nil

  done.set!
  ret
  close
end

#inc_indexObject



26
27
28
29
30
31
# File 'lib/pegarus/rubinius/generator.rb', line 26

def inc_index
  push_local 1
  send :+, 1, false
  set_local 1
  pop
end

#push_indexObject



17
18
19
# File 'lib/pegarus/rubinius/generator.rb', line 17

def push_index
  push_local 1
end

#push_subjectObject



13
14
15
# File 'lib/pegarus/rubinius/generator.rb', line 13

def push_subject
  push_local 0
end

#set_indexObject



21
22
23
24
# File 'lib/pegarus/rubinius/generator.rb', line 21

def set_index
  set_local 1
  pop
end