Checkpoint

This commit is contained in:
Iavor Diatchki 2020-11-12 15:48:43 -08:00
parent 111904d453
commit 6f23c7b08d
3 changed files with 11 additions and 5 deletions

View File

@ -176,7 +176,7 @@ instance PP ModuleError where
NoIncludeErrors _src errs -> vcat (map NoInc.ppIncludeError errs)
TypeCheckingFailed _src errs -> vcat (map T.ppError errs)
TypeCheckingFailed _src errs -> T.ppErrors errs
ModuleNameMismatch expected found ->
hang (text "[error]" <+> pp (P.srcRange found) <.> char ':')
@ -279,7 +279,7 @@ data ModuleWarning
instance PP ModuleWarning where
ppPrec _ w = case w of
TypeCheckWarnings ws -> vcat (map T.ppWarning ws)
TypeCheckWarnings ws -> T.ppWarnings ws
RenamerWarnings ws -> vcat (map pp ws)
warn :: [ModuleWarning] -> ModuleM ()

View File

@ -19,8 +19,10 @@ module Cryptol.TypeCheck
, nameSeeds
, Error(..)
, Warning(..)
, ppWarning
, ppError
-- , ppWarning
-- , ppError
, ppWarnings
, ppErrors
) where
import Cryptol.ModuleSystem.Name
@ -121,4 +123,8 @@ ppWarning (r,w) = text "[warning] at" <+> pp r <.> colon $$ nest 2 (pp w)
ppError :: (Range,Error) -> Doc
ppError (r,w) = text "[error] at" <+> pp r <.> colon $$ nest 2 (pp w)
ppWarnings :: [(Range,Warning)] -> Doc
ppWarnings = vcat . map ppWarning
ppErrors :: [(Range,Error)] -> Doc
ppErrors = vcat . map ppError

View File

@ -36,7 +36,7 @@ main =
print (pp prog)
InferFailed ws errs ->
do mapM_ (print . TC.ppWarning IMap.empty) ws
mapM_ (print . TC.ppError IMap.empty) errs
print (TC.ppErrors errs)
(_,errs) -> hPrint stderr $ vcat $ map pp errs
where