lib/personify/parser/personify_node_classes.rb in personify-1.1.0 vs lib/personify/parser/personify_node_classes.rb in personify-1.1.1
- old
+ new
@@ -72,12 +72,12 @@
def eval(env)
fe = first_expression.eval(env)
ne = next_expression.eval(env)
case operator.text_value
- when "&&" : fe && ne
- when "||" : fe || ne
+ when "&&" then fe && ne
+ when "||" then fe || ne
end
end
end
class Function < Treetop::Runtime::SyntaxNode
@@ -87,10 +87,14 @@
else
fn = self.key.eval(env)
end
if fn && fn.respond_to?(:call)
- fn.call(*self.function_parameters(env))
+ params = self.function_parameters(env)
+ if fn.arity >= 0
+ params = params[0,fn.arity]
+ end
+ fn.call(*params)
else
fn
end
rescue StandardError
return nil
\ No newline at end of file