git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Don't special case `let` in the commands.
commit7c191151f01c52b1f7ae14891b90edeecb48eae7 authorjoneshf <jones3.hardy@gmail.com> dateWed 19 Feb 2014, 10:23 (13 years ago) parent8559375
2 files changed+1−7
psci/Commands.hs−2 psci/Main.hs+1−5
psci/Commands.hs−2
@@ -8,7 +8,6 @@ data Command
88 | Expression [String]
99 | Help
1010 | Import String
11− | Let String
1211 | LoadFile FilePath
1312 | Quit
1413 | Reload
@@ -25,7 +24,6 @@ getCommand = do
2524 Just ":q" -> return Quit
2625 Just ":r" -> return Reload
2726 Just (':':_) -> return Unknown
28− Just l@('l':'e':'t':_) -> return $ Let l
2927 Just other -> Expression <$> go [other]
3028 where
3129 go ls = do
psci/Main.hs+1−5
@@ -164,7 +164,7 @@ parseExpression = P.whiteSpace *> P.parseValue <* Parsec.eof
164164handleCommand :: Command -> StateT PSCI (InputT IO) ()
165165handleCommand Empty = return ()
166166handleCommand (Expression ls) =
167− case P.runIndentParser "" parseDoNotationBind (unlines ls) of
167+ case P.runIndentParser "" parseDoNotationLet (unlines ls) of
168168 Left _ ->
169169 case P.runIndentParser "" parseExpression (unlines ls) of
170170 Left err -> inputTToState $ outputStrLn (show err)
@@ -172,10 +172,6 @@ handleCommand (Expression ls) =
172172 Right binder -> modify (updateBinders binder)
173173handleCommand Help = inputTToState $ outputStrLn helpMessage
174174handleCommand (Import moduleName) = modify (updateImports moduleName)
175−handleCommand (Let line) =
176− case P.runIndentParser "" parseDoNotationLet line of
177− Left err -> inputTToState $ outputStrLn (show err)
178− Right binder -> modify (updateBinders binder)
179175handleCommand (LoadFile filePath) = do
180176 mf <- ioToState $ loadModule filePath
181177 case mf of