bjpop / language-python

A parser for Python 2.x and 3.x written in Haskell
157 stars 46 forks source link

BinaryOp should use operator precedence #58

Closed augustss closed 4 years ago

augustss commented 4 years ago

Try

prettyText $ let x = Int 3 "3" () in BinaryOp (Multiply ()) (BinaryOp (Plus ()) x x ()) x ()

which evaluates to

"3 + 3 * 3"

which is just wrong.

bjpop commented 4 years ago

Closing as per: https://github.com/bjpop/language-python/issues/59