Class: Gobstones::Lang::PuedeMover
Instance Attribute Summary
#argument
Instance Method Summary
collapse
#equality_attributes, #initialize, #with_evaluated_argument_in
Methods inherited from Expression
#is_function_call?
#==, #equality_attributes
Instance Method Details
#argument_type ⇒ Object
43
44
45
|
# File 'lib/gobstones/lang/expressions/primitive_functions.rb', line 43
def argument_type
:Direction
end
|
#evaluate(context) ⇒ Object
33
34
35
36
37
|
# File 'lib/gobstones/lang/expressions/primitive_functions.rb', line 33
def evaluate(context)
with_evaluated_argument_in(context) do |result|
context.head.can_move?(result).to_gbs_bool
end
end
|
#to_s ⇒ Object
39
40
41
|
# File 'lib/gobstones/lang/expressions/primitive_functions.rb', line 39
def to_s
'puedeMover() expression'
end
|
#type_check ⇒ Object
47
48
49
|
# File 'lib/gobstones/lang/expressions/primitive_functions.rb', line 47
def type_check
TypeCheckResult.new(argument_type, argument.return_type)
end
|