Nathan Lamont

Notes to Self

A Mathematical Expression Parser in TypeScript

You want to make an expression parser for BC as a presumed send-off gift to handle things like ((CASTERLEVEL/3)+1). See spells-formatted.json in Downloads. Many seem to exist?

See https://blog.bitsrc.io/parsing-expressions-in-javascript-4c156f0cbaec for inspiration. PEDMAS, not BODMAS.

  • Update 3/12: you did this and put it in the code. Can't remember if you actually employed it or just let it sit there for future use