Add basic repl
[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