A Nice Pratt Parsing Demo
Requires Python 3. Try:
./tests.py ./arith_parse.py '1+2*3'
This code originally was originally based on the parser in tinypy, but every line has been changed, except possibly for some tests.
I had copied the precedences from bash's expr.c. (zsh and busybox ash also follow bash.) But Python and R parse it as -(3 ** 2) rather than (-3) ** 2. Fixes issue #1.