Class: Brainfuck::AST::IterationNode
- Inherits:
-
Struct
- Object
- Struct
- Brainfuck::AST::IterationNode
- Defined in:
- lib/brainfuck/ast.rb
Instance Attribute Summary collapse
-
#exp ⇒ Object
Returns the value of attribute exp.
Instance Method Summary collapse
Instance Attribute Details
#exp ⇒ Object
Returns the value of attribute exp
116 117 118 |
# File 'lib/brainfuck/ast.rb', line 116 def exp @exp end |
Instance Method Details
#bytecode(g) ⇒ Object
117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/brainfuck/ast.rb', line 117 def bytecode(g) repeat = g.new_label repeat.set! exp.bytecode(g) g.push_local 0 g.push_local 1 g.send :[], 1, true g. g. 0 g.gif repeat end |