Handle errors located in raw strings

This commit is contained in:
Guillaume Maudoux 2019-12-05 14:19:14 +01:00
parent 6bc278c859
commit 59698de718
1 changed files with 3 additions and 0 deletions

View File

@ -77,6 +77,9 @@ posAndMsg (SourcePos _ lineNo _) msg = FancyError
renderLocation :: MonadFile m => SrcSpan -> Doc a -> m (Doc a)
renderLocation (SrcSpan (SourcePos file begLine begCol) (SourcePos file' endLine endCol)) msg
| file == file' && file == "<string>" && begLine == endLine
= pure $ "In raw input string at position " <> pretty (unPos begCol)
| file /= "<string>" && file == file'
= do
exist <- doesFileExist file