From 446ee85894852c1dc516be2b1c4441dfb421e38d Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 19 Jul 2017 15:02:27 -0400 Subject: [PATCH] =?UTF-8?q?Pass=20extant=20blobs=E2=80=99=20paths=20to=20s?= =?UTF-8?q?howPos.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Data/Syntax/Assignment.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Data/Syntax/Assignment.hs b/src/Data/Syntax/Assignment.hs index 61e166b98..4044052a5 100644 --- a/src/Data/Syntax/Assignment.hs +++ b/src/Data/Syntax/Assignment.hs @@ -190,7 +190,7 @@ data ErrorCause grammar -- | Pretty-print an Error with reference to the source where it occurred. printError :: Show grammar => Blob -> Error grammar -> IO () printError Blob{..} error@Error{..} = do - withSGRCode [SetConsoleIntensity BoldIntensity] . putStrErr $ showPos Nothing errorPos . showString ": " + withSGRCode [SetConsoleIntensity BoldIntensity] . putStrErr $ showPos (maybe Nothing (const (Just blobPath)) blobKind) errorPos . showString ": " withSGRCode [SetColor Foreground Vivid Red] . putStrErr $ showString "error" . showString ": " . showExpectation error . showChar '\n' putStrErr $ showString (toS context) . (if isSuffixOf "\n" context then identity else showChar '\n') . showString (replicate (succ (Info.posColumn errorPos + lineNumberDigits)) ' ') withSGRCode [SetColor Foreground Vivid Green] . putStrErr $ showChar '^' . showChar '\n'