Closed tomek-he-him closed 9 years ago
http://mathjs.org/docs/expressions/syntax.html – this is the best formal spec for an arithmetic grammar I’ve found. A JS implementation is readily available and it’s much more robust than the current proof-of-concept eval-based code.
eval
The thing is opt-in and extensible (http://mathjs.org/docs/custom_bundling.html). It’s easy to implement in other languages.
An open question remains: how extensible should parametric-svg.js be?
math.parser
math
https://github.com/parametric-svg/-/tree/d7be8f275252640fcdcc24befdacb56427396156/packages/parametric-svg-parse already uses mathjs under the hood.
http://mathjs.org/docs/expressions/syntax.html – this is the best formal spec for an arithmetic grammar I’ve found. A JS implementation is readily available and it’s much more robust than the current proof-of-concept
eval
-based code.The thing is opt-in and extensible (http://mathjs.org/docs/custom_bundling.html). It’s easy to implement in other languages.
An open question remains: how extensible should parametric-svg.js be?
math.parser
with your own thing?math
to allow extending it? (I’m not a fan of this idea.)