Class: Sol::SetLocalNode

Inherits:
Struct
  • Object
show all
Defined in:
lib/sol/nodes.rb,
lib/sol/interpreter.rb

Overview

Setting the value of a local variable.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



70
71
72
# File 'lib/sol/nodes.rb', line 70

def name
  @name
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



70
71
72
# File 'lib/sol/nodes.rb', line 70

def value
  @value
end

Instance Method Details

#eval(context) ⇒ Object



151
152
153
154
155
# File 'lib/sol/interpreter.rb', line 151

def eval(context)

	context.locals[name] = value.eval(context)

end