Class: NameDisableLookupInstruction

Inherits:
Instruction show all
Defined in:
lib/instructions/name/name_disable_lookup.rb

Overview

Sets the value of the context attribute Interpreter#evaluate_references to false. This will persist until the next time the Interpreter evaluates a ReferencePoint; instead of attempting to look up the variable or name referred to by the ReferencePoint, it will instead push the ReferencePoint onto the :name stack.

needs: nothing

pushes: nothing

Instance Attribute Summary

Attributes inherited from Instruction

#context

Instance Method Summary collapse

Methods inherited from Instruction

all_instructions, #go, inherited, #initialize, #needs, #pushes, to_nudgecode

Constructor Details

This class inherits a constructor from Instruction

Instance Method Details

#cleanupObject



20
21
22
# File 'lib/instructions/name/name_disable_lookup.rb', line 20

def cleanup
  @context.evaluate_references = false
end

#deriveObject



18
19
# File 'lib/instructions/name/name_disable_lookup.rb', line 18

def derive
end

#preconditions?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/instructions/name/name_disable_lookup.rb', line 13

def preconditions?
  true
end

#setupObject



16
17
# File 'lib/instructions/name/name_disable_lookup.rb', line 16

def setup
end