megaparsec/nix/patches/idris.patch
1computer1 34b34c3d93 Decouple the error reporting-related methods from ‘Stream’
Split the ‘Stream’ type class. The methods ‘showTokens’ and ‘tokensLength’
have been put into a separate type class ‘VisualStream’, while ‘reachOffset’
and ‘reachOffsetNoLine’ are now in ‘TraversableStream’. This should make
defining ‘Stream’ instances for custom streams easier.

Defined ‘Stream’ instances for lists and ‘Seq’s.
2020-09-02 19:50:45 +02:00

14 lines
572 B
Diff

diff --git a/src/Idris/Parser/Stack.hs b/src/Idris/Parser/Stack.hs
index fb7b61144..991f50d48 100644
--- a/src/Idris/Parser/Stack.hs
+++ b/src/Idris/Parser/Stack.hs
@@ -84,7 +84,7 @@ instance Message ParseError where
(pos, _) = P.reachOffsetNoLine (parseErrorOffset err) (parseErrorPosState err)
#endif
messageText = PP.text . init . P.parseErrorTextPretty . parseError
- messageSource err = Just sline
+ messageSource err = sline
where
#if MIN_VERSION_megaparsec(8,0,0)
(sline, _) = P.reachOffset (parseErrorOffset err) (parseErrorPosState err)