[accept and parse statements on jhci prompt
John Meacham <john@repetae.net>**20051203122019] hunk ./Interactive.hs 12
+import FrontEnd.HsParser(parseHsStmt)
+import FrontEnd.ParseMonad
hunk ./Interactive.hs 15
-import Doc.Pretty
hunk ./Interactive.hs 16
-import Representation
+import Doc.Pretty
hunk ./Interactive.hs 22
-import Util.Interact
hunk ./Interactive.hs 23
+import Util.Interact
hunk ./Interactive.hs 44
-interact ho = beginInteraction emptyInteract { interactSettables = ["prog", "args"], interactVersion = versionString, interactCommands = commands } where
+interact ho = beginInteraction emptyInteract { interactSettables = ["prog", "args"], interactVersion = versionString, interactCommands = commands, interactExpr = do_expr } where
hunk ./Interactive.hs 62
-            f opt (x:xs) = f (x ++ opt) xs
+            f opt ~(x:xs) = f (x ++ opt) xs
+            f _ _ = undefined
hunk ./Interactive.hs 71
+    do_expr :: Interact -> String -> IO Interact
+    do_expr act s = case parseStmt s of
+        Left m -> putStrLn m >> return act
+        Right e -> putStrLn (show e) >> return act
+
+
+parseStmt ::  Monad m => String -> m HsStmt
+parseStmt s = case runParserWithMode ParseMode { parseFilename = "(jhci)" } parseHsStmt  s  of
+                      ParseOk e -> return e
+                      ParseFailed sl err -> fail $ show sl ++ ": " ++ err