Class: Kapusta::Compiler::Language::CountedForForm
- Inherits:
-
Struct
- Object
- Struct
- Kapusta::Compiler::Language::CountedForForm
- Defined in:
- lib/kapusta/compiler/language.rb
Instance Attribute Summary collapse
-
#bindings ⇒ Object
Returns the value of attribute bindings.
-
#body ⇒ Object
Returns the value of attribute body.
Instance Method Summary collapse
- #counter ⇒ Object
- #each_extra ⇒ Object
- #extras ⇒ Object
- #finish ⇒ Object
- #items ⇒ Object
- #start ⇒ Object
Instance Attribute Details
#bindings ⇒ Object
Returns the value of attribute bindings
93 94 95 |
# File 'lib/kapusta/compiler/language.rb', line 93 def bindings @bindings end |
#body ⇒ Object
Returns the value of attribute body
93 94 95 |
# File 'lib/kapusta/compiler/language.rb', line 93 def body @body end |
Instance Method Details
#counter ⇒ Object
96 |
# File 'lib/kapusta/compiler/language.rb', line 96 def counter = items[0] |
#each_extra ⇒ Object
104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/kapusta/compiler/language.rb', line 104 def each_extra i = 0 while i < extras.length item = extras[i] if item.is_a?(Sym) && item.name == '&until' yield :until, extras[i + 1] i += 2 else yield :step, item i += 1 end end end |
#extras ⇒ Object
102 |
# File 'lib/kapusta/compiler/language.rb', line 102 def extras = items[3..] || [] |
#finish ⇒ Object
100 |
# File 'lib/kapusta/compiler/language.rb', line 100 def finish = items[2] |
#items ⇒ Object
94 |
# File 'lib/kapusta/compiler/language.rb', line 94 def items = bindings.is_a?(Vec) ? bindings.items : [] |
#start ⇒ Object
98 |
# File 'lib/kapusta/compiler/language.rb', line 98 def start = items[1] |