From: Luke Lau Date: Sat, 18 May 2019 15:53:40 +0000 (+0100) Subject: Start parsing expressions X-Git-Url: http://git.lukelau.me/?a=commitdiff_plain;h=ae80d076cba678169dbddac4a53edd2cb1e091fb;hp=ae80d076cba678169dbddac4a53edd2cb1e091fb;p=kaleidoscope-hs.git Start parsing expressions This starts off with defining not the AST, but just what expressions we want to be able to parse. So far we just handle numbers, and addition involving 2 numbers. We use the built-in ReadPrec parser combinators, which allow us to recursively parse the binary op of addition, and even allow us to reuse the Read instance on Int! prec and step are needed since without them, parseAdd will just get stuck repeatedly trying to parse the left expression (a). ---