/rustcalc

Simple calculator on rust as a part of diving into the language

Primary LanguageRust

Calculator

Why?

In order to dive into Rust.

How?

Using simple lexer with radix tree for operators table, recursive top-down parser for AST and a simple recursive AST-evaluator.

Features?

Unary, exp, floats, variables, function calls.

Example

sum(1/2, 2.5) * -pi ** 2