projects
/
kaleidoscope-hs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Parse parentheses
[kaleidoscope-hs.git]
/
AST.hs
diff --git
a/AST.hs
b/AST.hs
index 7dad3a19e91eab9f12657101bd224b5c81742d07..e491b648a7d45f7bd3b419b0e3ff6a8c215cbd83 100644
(file)
--- 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