projects
/
kaleidoscope-hs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Add AST and parsing
[kaleidoscope-hs.git]
/
Main.hs
diff --git
a/Main.hs
b/Main.hs
index 76a9bdb5d48831da2e59c811ecbcbb5a379bdfb5..ec0de8c8bcfd731b298ed5a09c5df8784e9f0fd3 100644
(file)
--- a/
Main.hs
+++ b/
Main.hs
@@
-1
+1,10
@@
-main = pure ()
+import AST
+import System.IO
+import Text.Read
+main = do
+ hPutStr stderr "ready> "
+ ast <- (readMaybe <$> getLine) :: IO (Maybe AST)
+ case ast of
+ Just x -> hPrint stderr x
+ Nothing -> hPutStrLn stderr "Couldn't parse"
+ main