module NaiveMather
Overview
Calculates simple math equations, like "2 + 3 * (2 + 4)" Based on Ruby code written for blog by Lukasz Wrobel. https://lukaszwrobel.pl/blog/math-parser-part-3-implementation/
Defined in:
naive_mather/token.crnaive_mather/lexer.cr
naive_mather/parser.cr
naive_mather.cr
naive_mather/version.cr
Constant Summary
-
DEBUG =
false
-
VERSION =
"0.1.0"
Class Method Summary
-
.calculate(equation : String?)
Returns the result of calculating the passed equation.
Class Method Detail
def self.calculate(equation : String?)
#
Returns the result of calculating the passed equation.
NativeMather.calculate("2 + 3") # => 5