lib/dentaku/calculator.rb in dentaku-2.0.0 vs lib/dentaku/calculator.rb in dentaku-2.0.1
- old
+ new
@@ -12,16 +12,16 @@
clear
@tokenizer = Tokenizer.new
@ast_cache = {}
end
- def add_function(name, body)
- Dentaku::AST::Function.register(name, body)
+ def add_function(name, type, body)
+ Dentaku::AST::Function.register(name, type, body)
self
end
def add_functions(fns)
- fns.each { |(name, body)| add_function(name, body) }
+ fns.each { |(name, type, body)| add_function(name, type, body) }
self
end
def evaluate(expression, data={})
evaluate!(expression, data)