Class: Pegarus::Rubinius::Generator
- Inherits:
-
Rubinius::Generator
- Object
- Rubinius::Generator
- Pegarus::Rubinius::Generator
- Defined in:
- lib/pegarus/rubinius/generator.rb
Instance Attribute Summary collapse
-
#done ⇒ Object
readonly
Returns the value of attribute done.
-
#fail ⇒ Object
Returns the value of attribute fail.
Instance Method Summary collapse
- #finish ⇒ Object
- #inc_index ⇒ Object
-
#initialize ⇒ Generator
constructor
A new instance of Generator.
- #push_index ⇒ Object
- #push_subject ⇒ Object
- #set_index ⇒ Object
Constructor Details
#initialize ⇒ Generator
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
#done ⇒ Object (readonly)
Returns the value of attribute done.
4 5 6 |
# File 'lib/pegarus/rubinius/generator.rb', line 4 def done @done end |
#fail ⇒ Object
Returns the value of attribute fail.
5 6 7 |
# File 'lib/pegarus/rubinius/generator.rb', line 5 def fail @fail end |
Instance Method Details
#finish ⇒ Object
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_index ⇒ Object
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_index ⇒ Object
17 18 19 |
# File 'lib/pegarus/rubinius/generator.rb', line 17 def push_index push_local 1 end |
#push_subject ⇒ Object
13 14 15 |
# File 'lib/pegarus/rubinius/generator.rb', line 13 def push_subject push_local 0 end |
#set_index ⇒ Object
21 22 23 24 |
# File 'lib/pegarus/rubinius/generator.rb', line 21 def set_index set_local 1 pop end |