@@ -1130,10 +1130,12 @@ instance Pretty PTerm OutputAnnotation where
1130-- terminal.
1130-- terminal.
1131consoleDecorate :: IState -> OutputAnnotation -> String -> String
1131consoleDecorate :: IState -> OutputAnnotation -> String -> String
1132consoleDecorate ist _ | not (idris_colourRepl ist) = id
1132consoleDecorate ist _ | not (idris_colourRepl ist) = id
1133−consoleDecorate ist AnnConstData = let theme = idris_colourTheme ist
1133+consoleDecorate ist (AnnConst c) = let theme = idris_colourTheme ist
1134+ in if constIsType c
1135+ then colouriseType theme
1134− in colouriseData theme
1136+ else colouriseData theme
1135−consoleDecorate ist AnnConstType = let theme = idris_colourTheme ist
1137+consoleDecorate ist (AnnData _ _) = colouriseData (idris_colourTheme ist)
1136− in colouriseType theme
1138+consoleDecorate ist (AnnType _ _) = colouriseType (idris_colourTheme ist)
1137consoleDecorate ist (AnnBoundName _ True) = colouriseImplicit (idris_colourTheme ist)
1139consoleDecorate ist (AnnBoundName _ True) = colouriseImplicit (idris_colourTheme ist)
1138consoleDecorate ist (AnnBoundName _ False) = colouriseBound (idris_colourTheme ist)
1140consoleDecorate ist (AnnBoundName _ False) = colouriseBound (idris_colourTheme ist)
1139consoleDecorate ist AnnKeyword = colouriseKeyword (idris_colourTheme ist)
1141consoleDecorate ist AnnKeyword = colouriseKeyword (idris_colourTheme ist)
@@ -1175,7 +1177,7 @@ pprintPTerm ppo bnd docArgs infixes = prettySe 10 bnd
1175 prettySe p bnd (PPatvar fc n) = pretty n
1177 prettySe p bnd (PPatvar fc n) = pretty n
1176 prettySe p bnd e
1178 prettySe p bnd e
1177 | Just str <- slist p bnd e = str
1179 | Just str <- slist p bnd e = str
1178− | Just n <- snat p e = annotate AnnConstData (text (show n))
1180+ | Just n <- snat p e = annotate (AnnData "Nat" "") (text (show n))
1179 prettySe p bnd (PRef fc n) = prettyName (ppopt_impl ppo) bnd n
1181 prettySe p bnd (PRef fc n) = prettyName (ppopt_impl ppo) bnd n
1180 prettySe p bnd (PLam n ty sc) =
1182 prettySe p bnd (PLam n ty sc) =
1181 bracket p 2 . group . align . hang 2 $
1183 bracket p 2 . group . align . hang 2 $
@@ -1251,7 +1253,7 @@ pprintPTerm ppo bnd docArgs infixes = prettySe 10 bnd
1251 (left l <+> opName) <$> group (right r)
1253 (left l <+> opName) <$> group (right r)
1252 prettySe p bnd (PApp _ hd@(PRef fc f) [tm]) -- symbols, like 'foo
1254 prettySe p bnd (PApp _ hd@(PRef fc f) [tm]) -- symbols, like 'foo
1253 | PConstant (Idris.Core.TT.Str str) <- getTm tm,
1255 | PConstant (Idris.Core.TT.Str str) <- getTm tm,
1254− f == sUN "Symbol_" = annotate AnnConstType $
1256+ f == sUN "Symbol_" = annotate (AnnType ("'" ++ str) ("The symbol " ++ str)) $
1255 char '\'' <> prettySe 10 bnd (PRef fc (sUN str))
1257 char '\'' <> prettySe 10 bnd (PRef fc (sUN str))
1256 prettySe p bnd (PApp _ f as) = -- Normal prefix applications
1258 prettySe p bnd (PApp _ f as) = -- Normal prefix applications
1257 let args = getExps as
1259 let args = getExps as
@@ -1320,13 +1322,8 @@ pprintPTerm ppo bnd docArgs infixes = prettySe 10 bnd
1321 prettyAs =
1323 prettyAs =
1322 foldr (\l -> \r -> l <+> text "," <+> r) empty $ map (prettySe 10 bnd) as
1324 foldr (\l -> \r -> l <+> text "," <+> r) empty $ map (prettySe 10 bnd) as
1323− prettySe p bnd PType = annotate AnnConstType $ text "Type"
1325+ prettySe p bnd PType = annotate (AnnType "Type" "The type of types") $ text "Type"
1324− prettySe p bnd (PConstant c) = annotate (annot c) (text (show c))
1326+ prettySe p bnd (PConstant c) = annotate (AnnConst c) (text (show c))
1325− where annot (AType _) = AnnConstType
1326− annot StrType = AnnConstType
1327− annot PtrType = AnnConstType
1328− annot VoidType = AnnConstType
1329− annot _ = AnnConstData
1330 -- XXX: add pretty for tactics
1327 -- XXX: add pretty for tactics
1331 prettySe p bnd (PProof ts) =
1328 prettySe p bnd (PProof ts) =
1332 text "proof" <+> lbrace <> nest nestingSize (text . show $ ts) <> rbrace
1329 text "proof" <+> lbrace <> nest nestingSize (text . show $ ts) <> rbrace
@@ -1378,16 +1375,16 @@ pprintPTerm ppo bnd docArgs infixes = prettySe 10 bnd
1378 slist' _ _ tm = Nothing
1375 slist' _ _ tm = Nothing
1380 slist p bnd e | Just es <- slist' p bnd e = Just $
1377 slist p bnd e | Just es <- slist' p bnd e = Just $
1381− case es of [] -> annotate AnnConstData $ text "[]"
1378+ case es of [] -> annotate (AnnData "" "") $ text "[]"
1382 [x] -> enclose left right . group $
1379 [x] -> enclose left right . group $
1383 prettySe p bnd x
1380 prettySe p bnd x
1384 xs -> (enclose left right .
1381 xs -> (enclose left right .
1385 align . group . vsep .
1382 align . group . vsep .
1386 punctuate comma .
1383 punctuate comma .
1387 map (prettySe p bnd)) xs
1384 map (prettySe p bnd)) xs
1388− where left = (annotate AnnConstData (text "["))
1385+ where left = (annotate (AnnData "" "") (text "["))
1389− right = (annotate AnnConstData (text "]"))
1386+ right = (annotate (AnnData "" "") (text "]"))
1390− comma = (annotate AnnConstData (text ","))
1387+ comma = (annotate (AnnData "" "") (text ","))
1391 slist _ _ _ = Nothing
1388 slist _ _ _ = Nothing
1393 pairElts :: PTerm -> Maybe [PTerm]
1390 pairElts :: PTerm -> Maybe [PTerm]