Skip to content

Commit

Permalink
Handle errors located in raw strings
Browse files Browse the repository at this point in the history
  • Loading branch information
layus committed Nov 18, 2020
1 parent 6bc278c commit 59698de
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Nix/Render.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 59698de

Please sign in to comment.