X-Git-Url: https://git.lukelau.me/?p=kaleidoscope-hs.git;a=blobdiff_plain;f=AST.hs;h=e491b648a7d45f7bd3b419b0e3ff6a8c215cbd83;hp=7dad3a19e91eab9f12657101bd224b5c81742d07;hb=2f3c8f5cb6c8b9e6f5be02b20910f8105a9011a6;hpb=8a66ac4f81c3d1eab3b13a9e58cee0098573eff1 diff --git a/AST.hs b/AST.hs index 7dad3a1..e491b64 100644 --- a/AST.hs +++ b/AST.hs @@ -13,7 +13,7 @@ data BinOp = Add | Sub | Mul | Cmp Ordering deriving Show instance Read Expr where - readPrec = choice [ parseNum + readPrec = parens $ choice [ parseNum , parseVar , parseBinOp "<" 10 (Cmp LT) , parseBinOp "+" 20 Add