Sha256: 25c3d647ecd7b9db4ccb86b7aaf4dfa2ac2906954562032801c7cb8181d6e7a8

Contents?: true

Size: 385 Bytes

Versions: 1

Compression:

Stored size: 385 Bytes

Contents

# frozen_string_literal: true

module Tataru
  module Instructions
    # sets a hash entry based on whatever key was set
    class ValueInstruction < ImmediateModeInstruction
      def run
        return memory.error = 'No key set' unless memory.hash[:temp].key? :_key

        key = memory.hash[:temp].delete :_key
        memory.hash[:temp][key] = @param
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tataru-0.2.0 lib/tataru/instructions/value_instruction.rb