Commit Graph

7 Commits

Author SHA1 Message Date
Mark Karpov
2fd1884794 Fix nix definitions for Megaparsec 9 2020-10-12 20:17:15 +02:00
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
Mark Karpov
de1ae07eb8 Fix the nix-shell
After bumping the version to 8.0.0 some packages stopped building even
though we used ‘doJailbreak’. This moves the pin and drops many patches that
became unnecessary.
2020-02-27 23:46:09 +01:00
mrkkrp
09f92ca177
Bump version (8.0.0)
[skip ci]
2019-11-07 21:06:28 +01:00
mrkkrp
31b917b129 Allow registration of delayed parse errors
Megaparsec now supports registration of “delayed” parse errors. On lower
level we added a new field called ‘stateParseErrors’ to the ‘State’ record.
The type also had to change from ‘State s’ to ‘State s e’. This field
contains the list of registered ‘ParseErrors’ that do not end parsing
immediately but still will cause failure in the end if the list is not
empty. Users are expected to register parse errors using the three
functions: ‘registerParseError’, ‘registerFailure’, and
‘registerFancyFailure’. These functions are analogous to those without the
‘register’ prefix, except that they have “delayed” effect.
2019-11-07 12:48:56 +01:00
mrkkrp
f8ef95c025 Re-organize error reporting functions
The methods ‘failure’ and ‘fancyFailure’ of ‘MonadParsec’ are now ordinary
functions and live in ‘Text.Megaparsec’. They are defined in terms of the
new ‘parseError’ method of ‘MonadParsec’. This method allows us to signal
parse errors at a given offset without manipulating parser state manually.
2019-11-05 14:18:55 +01:00
mrkkrp
96303973fd Add nix development helpers and the hacking instructions 2019-10-20 15:31:31 +02:00