Sha256: 5f44a55117e56b478cfd4deeaafb905b97ae3df345873b6d0381d66ce791dda6

Contents?: true

Size: 713 Bytes

Versions: 3

Compression:

Stored size: 713 Bytes

Contents

# pops the top items of the +:exec+ and +:int+ stacks;
# pushes the +:exec+ down "into" the stack, at a level determined by the +:int+ "destination" value.
# 
# If the destination value is negative or 0, the item stays on top;
# if the destination value is greater than or equal to the depth of the stack, the item goes to the bottom;
# otherwise, the item is inserted farther from the stack's top as the destination value increases.
# 
# note: the destination depth is calculated after the items have been popped
#
# *needs:* 1 +:exec+, 1 +:int+
#
# *pushes:* 1 +:exec+ (sortof)
#

class ExecShoveInstruction < Instruction
  include ShoveInstruction
  def initialize(context)
    super(context, :exec)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nudge-0.2.9 lib/instructions/exec/exec_shove.rb
nudge-0.2.8 lib/instructions/exec/exec_shove.rb
nudge-0.2.7 lib/instructions/exec/exec_shove.rb