danm v0.1.4 Danm.SimpleExpr
SimpleExpr parse and evaluate expression with integers.
Link to this section Summary
Functions
ast_string(ast) return a string representation of ast
eval(ast) evaluate ast without identifier map
eval(ast, in: dict) evaluate ast with identifier map in: dict
optimize(ast) try to optimize the ast
parse(str) parse the str 3 orders of operator precedance
valid?(ast) check ast without identifier map
valid?(ast, in: dict) check ast with identifier map in: dict
Link to this section Functions
ast_string(n)
ast_string(ast) return a string representation of ast
eval(n)
eval(ast) evaluate ast without identifier map
eval(n, list)
eval(ast, in: dict) evaluate ast with identifier map in: dict
optimize(n)
optimize(ast) try to optimize the ast
parse(s)
parse(str) parse the str 3 orders of operator precedance:
* / %
+ -
<< >>
valid?(ast)
valid?(ast) check ast without identifier map
valid?(n, list)
valid?(ast, in: dict) check ast with identifier map in: dict