Commit Graph

17 Commits

Author SHA1 Message Date
Alex Chen
880e6e0a32 lib: add a custom parse error for "re-parsing"
- for pretty-printing parse errors thrown from the parsing of excerpts
  of the source text as if they were thrown from the parsing of the
  source text itself
2018-11-22 14:09:32 -08:00
Peter Simons
027d084878 Drop undecidable Ord instance for ParseError.
That code fails to compile with ghc-8.6.1 because the instance is undecidable.
I suppose we could enable the appropriate compiler extension to support it, but
I've found that simply removing the instance causes no problems whatsoever: the
entire repository still compiles fine and it passes all test suites, too.
2018-10-24 10:35:11 -07:00
Alex Chen
a8d642d5b5 lib: revise comments for "final" parse errors
- also simplify their implementation a bit
2018-10-09 11:05:46 -06:00
Alex Chen
3d2584d869 lib: switch to megaparsec 7 2018-09-30 20:15:12 -06:00
Alex Chen
26369c28a3 lib: remove old code for include file parse errors 2018-09-29 22:55:10 -06:00
Alex Chen
855a8f1985 lib: Re-implement the 'ExceptT' layer of the parser
We previously had another parser type, 'type ErroringJournalParser =
ExceptT String ...' for throwing parse errors without the possibility of
backtracking. This parser type was removed under the assumption that it
would be possible to write our parser without this capability. However,
after a hairy backtracking bug, we would now prefer to have the option
to prevent backtracking.

- Define a 'FinalParseError' type specifically for the 'ExceptT' layer
- Any parse error can be raised as a "final" parse error
- Tracks the stack of include files for parser errors, anticipating the
  removal of the tracking of stacks of include files in megaparsec 7
  - Although a stack of include files is also tracked in the 'StateT
    Journal' layer of the parser, it seems easier to guarantee correct
    error messages in the 'ExceptT FinalParserError' layer
  - This does not make the 'StateT Journal' stack redundant because the
    'ExceptT FinalParseError' stack cannot be used to detect cycles of
    include files
2018-09-29 22:33:34 -06:00
Alex Chen
2b3c97e1af lib: tweak custom parse errors
- Don't immediately throw custom parse errors into 'ParsecT'; rather,
  just construct and return them
- This anticipates the re-implementation of an 'ExceptT' layer of the
  parser, which should be able throw custom parse errors
2018-09-29 22:32:34 -06:00
Alex Chen
0382bb5cd4 lib: move custom parse errors to Text.Megaparsec.Custom 2018-06-11 13:58:56 -06:00
Alex Chen
b245ec7b3d lib: remove the megaparsec compatability module 2018-05-22 12:16:46 -07:00
Simon Michael
581d02162c resolve all current build warnings with the supported GHC versions
If I'm lucky.
2018-05-17 20:43:55 -07:00
Simon Michael
43287a3e26 budget: use a new first-class BudgetReport for --budget 2018-04-23 18:52:28 -07:00
Simon Michael
20442196fb lib: refactor 2017-07-31 07:09:06 -07:00
Simon Michael
f1c5cce575 lib: another doctests fix, replace wrong haddock char 2017-07-31 07:09:06 -07:00
Simon Michael
ecfc8224dd lib: cleanup up megaparsec 6 compat module, simplify error type (#594) 2017-07-28 07:53:02 -07:00
Simon Michael
d7d5f8a064 add support for megaparsec 6 (fixes #594)
Older megaparsec is still supported.
Also cleans up our custom parser types,
and some text (un)packing is done in different places
(possible performance impact).
2017-07-27 19:20:46 -07:00
Simon Michael
deea422dc1 fix build error (#242) 2015-09-29 21:16:51 -10:00
Simon Michael
58b98faf36 balance: wide-char-aware multicolumn reports (#242) 2015-09-29 20:54:05 -10:00