Skip to content

Commit

Permalink
Add at on errors and warnings to be more consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottt committed Dec 4, 2014
1 parent 308908b commit 7cac018
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Cryptol/ModuleSystem/Renamer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ instance PP RenamerError where
ppPrec _ e = case e of

MultipleSyms lqn qns ->
hang (text "[error]" <+> pp (srcRange lqn))
hang (text "[error] at" <+> pp (srcRange lqn))
4 $ (text "Multiple definitions for symbol:" <+> pp (thing lqn))
$$ vcat (map pp qns)

UnboundExpr lqn ->
hang (text "[error]" <+> pp (srcRange lqn))
hang (text "[error] at" <+> pp (srcRange lqn))
4 (text "Value not in scope:" <+> pp (thing lqn))

UnboundType lqn ->
hang (text "[error]" <+> pp (srcRange lqn))
hang (text "[error] at" <+> pp (srcRange lqn))
4 (text "Type not in scope:" <+> pp (thing lqn))

OverlappingSyms qns ->
Expand All @@ -80,13 +80,13 @@ instance PP RenamerError where
$$ vcat (map pp qns)

ExpectedValue lqn ->
hang (text "[error]" <+> pp (srcRange lqn))
hang (text "[error] at" <+> pp (srcRange lqn))
4 (fsep [ text "Expected a value named", quotes (pp (thing lqn))
, text "but found a type instead"
, text "Did you mean `(" <> pp (thing lqn) <> text")?" ])

ExpectedType lqn ->
hang (text "[error]" <+> pp (srcRange lqn))
hang (text "[error] at" <+> pp (srcRange lqn))
4 (fsep [ text "Expected a type named", quotes (pp (thing lqn))
, text "but found a value instead" ])

Expand All @@ -98,7 +98,7 @@ data RenamerWarning

instance PP RenamerWarning where
ppPrec _ (SymbolShadowed new originals) =
hang (text "[warning]" <+> loc)
hang (text "[warning] at" <+> loc)
4 $ fsep [ text "This binding for" <+> sym
, text "shadows the existing binding" <> plural <+> text "from" ]
$$ vcat (map pp originals)
Expand Down

0 comments on commit 7cac018

Please sign in to comment.