when @str.scan(/;͐;/) then [:dup] when @str.scan(/;͑;#{NUM}/) then [:copy, num(@str[1])] when @str.scan(/;͐͑/) then [:swap] when @str.scan(/;͐͐/) then [:discard] when @str.scan(/;͑͐#{NUM}/) then [:slide, num(@str[1])] when @str.scan(/͑;;;/) then [:add] when @str.scan(/͑;;͑/) then [:sub]
pc < @instructions.size instructions, arg = *@instructions[pc] case instructions when :push push(arg) when :dup push(@stack[-1]) when :copy push(@stack[-(arg+1)]) when :swap y, x = pop, pop push(y) push(x)