Class: Braingasm::Parser::Loop

Inherits:
Object
  • Object
show all
Defined in:
lib/braingasm/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#start_indexObject

Returns the value of attribute start_index.



95
96
97
# File 'lib/braingasm/parser.rb', line 95

def start_index
  @start_index
end

#stop_indexObject

Returns the value of attribute stop_index.



95
96
97
# File 'lib/braingasm/parser.rb', line 95

def stop_index
  @stop_index
end

Instance Method Details

#call(machine) ⇒ Object



97
98
99
# File 'lib/braingasm/parser.rb', line 97

def call(machine)
  machine.inst_jump_if_zero(stop_index + 1)
end