Skip to content

Instantly share code, notes, and snippets.

@yarinb
yarinb / arithmetic.py
Created December 1, 2019 14:02 — forked from adamnew123456/arithmetic.py
Pratt Parser For Arithmetic Expressions
"""
This implements a fairly simple expression language via a Pratt-style parser.
The language supports fairly standard floating point literals, such as:
5
1.09
.16
12e7