But to give you an idea of what that all looks like this is the code for the parser that parses the "as a % of" operator:
append(
string("as"),
oneOrMore(space),
optional(append(string("a"), oneOrMore(space))),
percentSymbol,
oneOrMore(space),
string("of")
)
[0] https://github.com/bodil/eulalieI wasn't familiar with Eulalie, that's a really interesting approach. I built functionality [0] similar to numpad into a larger record-keeping system, Tap [1]. Precedence rules kindof scramble my brain so I ended up implementing s-expression syntax for Tap formulas.
I ended up writing the parser myself, called sowhat, but used a library for tokenization, moo.js [2]. You can see a demo of just the sowhat editor here [3].
0. https://www.tatatap.com/formulas 1. https://www.tatatap.com 2. https://github.com/no-context/moo 3. https://tatatap-com.github.io/sowhat-editor/
Even includes error handling :)
At the bottom you can see some test examples of what it can do. Obviously it is a basic calculator.