on master help sign in
"Fix" unindented do blocks in let bindings
b73004aEcho Nolan
src/Idris/REPL/Parser.hs+28−28
@@ -214,8 +214,8 @@ cmd xs = try $ do
214noArgs :: Command -> String -> P.IdrisParser (Either String Command)
214noArgs :: Command -> String -> P.IdrisParser (Either String Command)
215noArgs cmd name = do
215noArgs cmd name = do
216 let emptyArgs = do
216 let emptyArgs = do
217− eof
217+ eof
218− return (Right cmd)
218+ return (Right cmd)
219
219
220 let failure = return (Left $ ":" ++ name ++ " takes no arguments")
220 let failure = return (Left $ ":" ++ name ++ " takes no arguments")
221
221
@@ -229,17 +229,17 @@ eval = do
229exprArg :: (PTerm -> Command) -> String -> P.IdrisParser (Either String Command)
229exprArg :: (PTerm -> Command) -> String -> P.IdrisParser (Either String Command)
230exprArg cmd name = do
230exprArg cmd name = do
231 let noArg = do
231 let noArg = do
232− eof
232+ eof
233− return $ Left ("Usage is :" ++ name ++ " <expression>")
233+ return $ Left ("Usage is :" ++ name ++ " <expression>")
234
234
235 let justOperator = do
235 let justOperator = do
236− (op, fc) <- P.operatorFC
236+ (op, fc) <- P.operatorFC
237− eof
237+ eof
238− return $ Right $ cmd (PRef fc [] (sUN op))
238+ return $ Right $ cmd (PRef fc [] (sUN op))
239
239
240 let properArg = do
240 let properArg = do
241− t <- P.fullExpr defaultSyntax
241+ t <- P.fullExpr defaultSyntax
242− return $ Right (cmd t)
242+ return $ Right (cmd t)
243 try noArg <|> try justOperator <|> properArg
243 try noArg <|> try justOperator <|> properArg
244
244
245
245
@@ -279,10 +279,10 @@ optArg cmd name = do
279 return $ Left ("Usage is :" ++ name ++ " <option>")
279 return $ Left ("Usage is :" ++ name ++ " <option>")
280
280
281 let oneArg = do
281 let oneArg = do
282− o <- pOption
282+ o <- pOption
283− P.whiteSpace
283+ P.whiteSpace
284− eof
284+ eof
285− return (Right (cmd o))
285+ return (Right (cmd o))
286
286
287 let failure = return $ Left "Unrecognized setting"
287 let failure = return $ Left "Unrecognized setting"
288
288
@@ -304,14 +304,14 @@ proofArg cmd name = do
304cmd_doc :: String -> P.IdrisParser (Either String Command)
304cmd_doc :: String -> P.IdrisParser (Either String Command)
305cmd_doc name = do
305cmd_doc name = do
306 let constant = do
306 let constant = do
307− c <- fmap fst P.constant
307+ c <- fmap fst P.constant
308− eof
308+ eof
309− return $ Right (DocStr (Right c) FullDocs)
309+ return $ Right (DocStr (Right c) FullDocs)
310
310
311 let pType = do
311 let pType = do
312− P.reserved "Type"
312+ P.reserved "Type"
313− eof
313+ eof
314− return $ Right (DocStr (Left $ P.mkName ("Type", "")) FullDocs)
314+ return $ Right (DocStr (Left $ P.mkName ("Type", "")) FullDocs)
315
315
316 let fnName = fnNameArg (\n -> DocStr (Left n) FullDocs) name
316 let fnName = fnNameArg (\n -> DocStr (Left n) FullDocs) name
317
317
@@ -380,17 +380,17 @@ cmd_compile name = do
380 bytecodeCodegen <|> viaCodegen
380 bytecodeCodegen <|> viaCodegen
381
381
382 let hasOneArg = do
382 let hasOneArg = do
383− i <- get
383+ i <- get
384− f <- fst <$> P.identifier
384+ f <- fst <$> P.identifier
385− eof
385+ eof
386− return $ Right (Compile defaultCodegen f)
386+ return $ Right (Compile defaultCodegen f)
387
387
388 let hasTwoArgs = do
388 let hasTwoArgs = do
389− i <- get
389+ i <- get
390− codegen <- codegenOption
390+ codegen <- codegenOption
391− f <- fst <$> P.identifier
391+ f <- fst <$> P.identifier
392− eof
392+ eof
393− return $ Right (Compile codegen f)
393+ return $ Right (Compile codegen f)
394
394
395 let failure = return $ Left $ "Usage is :" ++ name ++ " [<codegen>] <filename>"
395 let failure = return $ Left $ "Usage is :" ++ name ++ " [<codegen>] <filename>"
396 try hasTwoArgs <|> try hasOneArg <|> failure
396 try hasTwoArgs <|> try hasOneArg <|> failure