@@ -327,8 +327,9 @@ runIdeSlaveCommand id orig fn mods (IdeSlave.Metavariables cols) =
327 -> ([(String, String, SpanList OutputAnnotation)],
327 -> ([(String, String, SpanList OutputAnnotation)],
328 (String, SpanList OutputAnnotation))
328 (String, SpanList OutputAnnotation))
329 sexpGoal ist cols imp ns ([], concl) =
329 sexpGoal ist cols imp ns ([], concl) =
330+ let infixes = idris_infixes ist
330− let concl' = displaySpans . renderPretty 0.9 cols . fmap (fancifyAnnots ist) $
331+ concl' = displaySpans . renderPretty 0.9 cols . fmap (fancifyAnnots ist) $
331− pprintPTerm imp (zip ns (repeat False)) [] concl
332+ pprintPTerm imp (zip ns (repeat False)) [] infixes concl
332 in ([], concl')
333 in ([], concl')
333 sexpGoal ist cols imp ns ((n, t):ps, concl) =
334 sexpGoal ist cols imp ns ((n, t):ps, concl) =
334 let n' = case n of
335 let n' = case n of
@@ -337,7 +338,7 @@ runIdeSlaveCommand id orig fn mods (IdeSlave.Metavariables cols) =
337 | otherwise -> str nm
338 | otherwise -> str nm
339 (t', spans) = displaySpans . renderPretty 0.9 cols . fmap (fancifyAnnots ist) $
340 (t', spans) = displaySpans . renderPretty 0.9 cols . fmap (fancifyAnnots ist) $
340− pprintPTerm imp (zip ns (repeat False)) [] t
341+ pprintPTerm imp (zip ns (repeat False)) [] (idris_infixes ist) t
341 rest = sexpGoal ist cols imp (n:ns) (ps, concl)
342 rest = sexpGoal ist cols imp (n:ns) (ps, concl)
342 in ((n', t', spans) : fst rest, snd rest)
343 in ((n', t', spans) : fst rest, snd rest)
343runIdeSlaveCommand id orig fn mods (IdeSlave.WhoCalls n) =
344runIdeSlaveCommand id orig fn mods (IdeSlave.WhoCalls n) =
@@ -562,21 +563,19 @@ process h fn (Eval t)
562 ist <- getIState
563 ist <- getIState
563 logLvl 3 $ "Raw: " ++ show (tm', ty')
564 logLvl 3 $ "Raw: " ++ show (tm', ty')
564 logLvl 10 $ "Debug: " ++ showEnvDbg [] tm'
565 logLvl 10 $ "Debug: " ++ showEnvDbg [] tm'
565− let imp = opt_showimp (idris_options ist)
566− tmDoc = prettyImp imp (delab ist tm')
566+ let tmDoc = prettyIst ist (delab ist tm')
567− tyDoc = prettyImp imp (delab ist ty')
567+ tyDoc = prettyIst ist (delab ist ty')
568 ihPrintTermWithType h tmDoc tyDoc
568 ihPrintTermWithType h tmDoc tyDoc
570process h fn (ExecVal t)
570process h fn (ExecVal t)
571 = do ctxt <- getContext
571 = do ctxt <- getContext
572 ist <- getIState
572 ist <- getIState
573− let imp = opt_showimp (idris_options ist)
574 (tm, ty) <- elabVal toplevel False t
573 (tm, ty) <- elabVal toplevel False t
575-- let tm' = normaliseAll ctxt [] tm
574-- let tm' = normaliseAll ctxt [] tm
576 let ty' = normaliseAll ctxt [] ty
575 let ty' = normaliseAll ctxt [] ty
577 res <- execute tm
576 res <- execute tm
578− let (resOut, tyOut) = (prettyImp imp (delab ist res),
577+ let (resOut, tyOut) = (prettyIst ist (delab ist res),
579− prettyImp imp (delab ist ty'))
578+ prettyIst ist (delab ist ty'))
580 ihPrintTermWithType h resOut tyOut
579 ihPrintTermWithType h resOut tyOut
582process h fn (Check (PRef _ n))
581process h fn (Check (PRef _ n))
@@ -611,7 +610,7 @@ process h fn (Check (PRef _ n))
611 annotate (AnnName n Nothing Nothing Nothing) (text $ show n) <+> colon <+>
610 annotate (AnnName n Nothing Nothing Nothing) (text $ show n) <+> colon <+>
612 align (tPretty bnd ist g)
611 align (tPretty bnd ist g)
614− tPretty bnd ist t = pprintPTerm (opt_showimp (idris_options ist)) bnd [] t
613+ tPretty bnd ist t = pprintPTerm (opt_showimp (idris_options ist)) bnd [] (idris_infixes ist) t
617process h fn (Check t)
616process h fn (Check t)
@@ -622,19 +621,18 @@ process h fn (Check t)
622 ty' = normaliseC ctxt [] ty
621 ty' = normaliseC ctxt [] ty
623 case tm of
622 case tm of
624 TType _ ->
623 TType _ ->
625− ihPrintTermWithType h (prettyImp imp PType) type1Doc
624+ ihPrintTermWithType h (prettyIst ist PType) type1Doc
626− _ -> ihPrintTermWithType h (prettyImp imp (delab ist tm))
625+ _ -> ihPrintTermWithType h (prettyIst ist (delab ist tm))
627− (prettyImp imp (delab ist ty))
626+ (prettyIst ist (delab ist ty))
629process h fn (DocStr n)
628process h fn (DocStr n)
630− = do i <- getIState
629+ = do ist <- getIState
631− let imp = opt_showimp (idris_options i)
632− case lookupCtxtName n (idris_docstrings i) of
630+ case lookupCtxtName n (idris_docstrings ist) of
633 [] -> iPrintError $ "No documentation for " ++ show n
631 [] -> iPrintError $ "No documentation for " ++ show n
634− ns -> do toShow <- mapM (showDoc imp) ns
632+ ns -> do toShow <- mapM (showDoc ist) ns
635 ihRenderResult h (vsep toShow)
633 ihRenderResult h (vsep toShow)
636− where showDoc imp (n, d) = do doc <- getDocs n
634+ where showDoc ist (n, d) = do doc <- getDocs n
637− return $ pprintDocs imp doc
635+ return $ pprintDocs ist doc
638process h fn Universes
636process h fn Universes
639 = do i <- getIState
637 = do i <- getIState
640 let cs = idris_constraints i
638 let cs = idris_constraints i
@@ -826,9 +824,11 @@ process h fn (DoProofSearch updatefile rec l n hints)
826 (tm, ty) <- elabVal toplevel False (PRef fc mn)
824 (tm, ty) <- elabVal toplevel False (PRef fc mn)
827 ctxt <- getContext
825 ctxt <- getContext
828 i <- getIState
826 i <- getIState
827+ return . flip displayS "" . renderPretty 1.0 80 $
828+ pprintPTerm False [] [] (idris_infixes i)
829− return $ show (stripNS
829+ (stripNS
830− (dropCtxt envlen
830+ (dropCtxt envlen
831− (delab i (specialise ctxt [] [(mn, 1)] tm)))))
831+ (delab i (specialise ctxt [] [(mn, 1)] tm)))))
832 (\e -> return ("?" ++ show n))
832 (\e -> return ("?" ++ show n))
833 if updatefile then
833 if updatefile then
834 do let fb = fn ++ "~"
834 do let fb = fn ++ "~"
@@ -1031,6 +1031,8 @@ process h fn (SetOpt ShowOrigErr) = setShowOrigErr True
1031process h fn (UnsetOpt ShowOrigErr) = setShowOrigErr False
1031process h fn (UnsetOpt ShowOrigErr) = setShowOrigErr False
1032process h fn (SetOpt AutoSolve) = setAutoSolve True
1032process h fn (SetOpt AutoSolve) = setAutoSolve True
1033process h fn (UnsetOpt AutoSolve) = setAutoSolve False
1033process h fn (UnsetOpt AutoSolve) = setAutoSolve False
1034+process h fn (SetOpt NoBanner) = setNoBanner True
1035+process h fn (UnsetOpt NoBanner) = setNoBanner False
1035process h fn (SetOpt _) = iPrintError "Not a valid option"
1037process h fn (SetOpt _) = iPrintError "Not a valid option"
1036process h fn (UnsetOpt _) = iPrintError "Not a valid option"
1038process h fn (UnsetOpt _) = iPrintError "Not a valid option"
@@ -1051,15 +1053,14 @@ process h fn (SetConsoleWidth w) = setWidth w
1052process h fn (Apropos a) =
1054process h fn (Apropos a) =
1053 do ist <- getIState
1055 do ist <- getIState
1054− let impl = opt_showimp (idris_options ist)
1055 let names = apropos ist (T.pack a)
1056 let names = apropos ist (T.pack a)
1056 let aproposInfo = [ (n,
1057 let aproposInfo = [ (n,
1057 delabTy ist n,
1058 delabTy ist n,
1058 fmap (overview . fst) (lookupCtxtExact n (idris_docstrings ist)))
1059 fmap (overview . fst) (lookupCtxtExact n (idris_docstrings ist)))
1059 | n <- sort names, isUN n ]
1060 | n <- sort names, isUN n ]
1060− ihRenderResult h $ vsep (map (renderApropos impl) aproposInfo)
1061+ ihRenderResult h $ vsep (map (renderApropos ist) aproposInfo)
1061− where renderApropos impl (name, ty, docs) =
1062+ where renderApropos ist (name, ty, docs) =
1062− prettyName True [] name <+> colon <+> align (prettyImp impl ty) <$>
1063+ prettyName True [] name <+> colon <+> align (prettyIst ist ty) <$>
1063 fromMaybe empty (fmap (\d -> renderDocstring d <> line) docs)
1064 fromMaybe empty (fmap (\d -> renderDocstring d <> line) docs)
1064 isUN (UN _) = True
1065 isUN (UN _) = True
1065 isUN (NS n _) = isUN n
1066 isUN (NS n _) = isUN n
@@ -1258,11 +1259,11 @@ loadInputs h inputs
1258 idris_patdefs = patdefs }))
1259 idris_patdefs = patdefs }))
1259 (\e -> do i <- getIState
1260 (\e -> do i <- getIState
1260 case e of
1261 case e of
1261− At f _ -> do setErrSpan f
1262+ At f e' -> do setErrSpan f
1262− ihRenderError stdout $ pprintErr i e
1263+ ihWarn stdout f $ pprintErr i e'
1263 ProgramLineComment -> return () -- fail elsewhere
1264 ProgramLineComment -> return () -- fail elsewhere
1264 _ -> do setErrSpan emptyFC -- FIXME! Propagate it
1265 _ -> do setErrSpan emptyFC -- FIXME! Propagate it
1265− iputStrLn (pshow i e))
1266+ ihWarn stdout emptyFC $ pprintErr i e)
1266 where -- load all files, stop if any fail
1267 where -- load all files, stop if any fail
1267 tryLoad :: Bool -> [IFileType] -> Idris ()
1268 tryLoad :: Bool -> [IFileType] -> Idris ()
1268 tryLoad keepstate [] = return ()
1269 tryLoad keepstate [] = return ()
@@ -1353,6 +1354,7 @@ idrisMain opts =
1353 setVerbose verbose
1354 setVerbose verbose
1354 setCmdLine opts
1355 setCmdLine opts
1355 setOutputTy outty
1356 setOutputTy outty
1357+ setNoBanner nobanner
1356 setCodegen cgn
1358 setCodegen cgn
1357 setTargetTriple trpl
1359 setTargetTriple trpl
1358 setTargetCPU tcpu
1360 setTargetCPU tcpu
@@ -1367,6 +1369,8 @@ idrisMain opts =
1367 (d:_) -> setIBCSubDir d
1369 (d:_) -> setIBCSubDir d
1368 setImportDirs importdirs
1370 setImportDirs importdirs
1372+ setNoBanner nobanner
1370 when (not (NoBasePkgs `elem` opts)) $ do
1374 when (not (NoBasePkgs `elem` opts)) $ do
1371 addPkgDir "prelude"
1375 addPkgDir "prelude"
1372 addPkgDir "base"
1376 addPkgDir "base"
@@ -1376,6 +1380,11 @@ idrisMain opts =
1376 return ()
1380 return ()
1377 when (not (NoPrelude `elem` opts)) $ do x <- loadModule stdout "Prelude"
1381 when (not (NoPrelude `elem` opts)) $ do x <- loadModule stdout "Prelude"
1378 return ()
1382 return ()
1384+ when (runrepl && not idesl) initScript
1386+ nobanner <- getNoBanner
1379 when (runrepl &&
1388 when (runrepl &&
1380 not quiet &&
1389 not quiet &&
1381 not idesl &&
1390 not idesl &&
@@ -1426,7 +1435,6 @@ idrisMain opts =
1427 when (runrepl && not idesl) $ do
1436 when (runrepl && not idesl) $ do
1428-- clearOrigPats
1437-- clearOrigPats
1430 startServer orig inputs
1438 startServer orig inputs
1431 runInputT (replSettings (Just historyFile)) $ repl orig inputs
1439 runInputT (replSettings (Just historyFile)) $ repl orig inputs
1432 when (idesl) $ ideslaveStart orig inputs
1440 when (idesl) $ ideslaveStart orig inputs