Is there any canonical question about parsing mathematical expressions1 with the proper tools and methods, which can be used for duplicate closure?
1 A somewhat OK answer should be able to parse an expression with the basic operators +
(binary and unary), -
(binary and unary), *
, /
and arbitrarily nesting ()
. A better answer would layout the idea and framework to add support for mathematical functions and other binary operators, plus handling associativity.
It would be great if there is a list of language-specific Q&A, plus a language agnostic Q&A.
Such questions show up frequently in the regex, and they are answered in minutes with regex. Those are usually terrible solutions which breaks like twig on slightly more complex input.