Handle errors located in raw strings
This commit is contained in:
parent
6bc278c859
commit
59698de718
|
@ -77,6 +77,9 @@ posAndMsg (SourcePos _ lineNo _) msg = FancyError
|
||||||
|
|
||||||
renderLocation :: MonadFile m => SrcSpan -> Doc a -> m (Doc a)
|
renderLocation :: MonadFile m => SrcSpan -> Doc a -> m (Doc a)
|
||||||
renderLocation (SrcSpan (SourcePos file begLine begCol) (SourcePos file' endLine endCol)) msg
|
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'
|
| file /= "<string>" && file == file'
|
||||||
= do
|
= do
|
||||||
exist <- doesFileExist file
|
exist <- doesFileExist file
|
||||||
|
|
Loading…
Reference in a new issue