impzero / methor

A simple math parser and evaluator from scratch, using https://github.com/fr3fou/djena/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

methor

A simple math parser and evaluator

Usage

$ deno run ./main.ts repl
# or
$ deno run ./main.ts 5+3

TODO

  • Precedence
    • The deeper an operator parser is in the callstack, the higher precedence it has
  • Intersperse calls with whitespace eating
  • Negative numbers
  • Grouped expressions
  • Builtin math funcs
    • sin
    • cos
    • abs
    • pow
  • REPL
  • Evaluation
  • Constants
    • PI
    • TAU
  • Fix left/right associativity
    • 50/2*2+10 should evaluate to 60, not 22.5
  • Tests
  • More operators
  • Floats
  • Unary operators

About

A simple math parser and evaluator from scratch, using https://github.com/fr3fou/djena/


Languages

Language:TypeScript 100.0%