You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
calculator = Dentaku::Calculator.new
calculator.add_function(:custom, :integer, lambda do
1
end)
calculator.ast("CUSTOM(1,2)") #=> Dentaku::ParseError (Dentaku::AST::Function::Custom has too many operands)
calculator.ast("CUSTOM(1,2)") #=> Dentaku::ParseError (Dentaku::AST::Function::Custom has too many operands)
calculator = Dentaku::Calculator.new
calculator.add_function(:custom, :integer, lambda do
1
end)
calculator.ast("CUSTOM(1,2)") #=> Dentaku::ParseError (#<Class:0x00007fbc1a57ecb0> has too many operands)
Probably some caching issue? The method class is not shown but instead an anonymous class.
One quick fix would be to change the fail! method but I think that's not the root cause:
def fail!(reason, **meta)
message =
case reason
....
when :too_many_operands
"#{meta.fetch(:operator).name} has too many operands"
The text was updated successfully, but these errors were encountered:
Probably some caching issue? The method class is not shown but instead an anonymous class.
One quick fix would be to change the fail! method but I think that's not the root cause:
The text was updated successfully, but these errors were encountered: