hledger/hledger-lib/Hledger/Read
Hans-Peter Deifel ae73c525d8 Fix csv rules parsing (#407)
* csv rules: Show prettier parsing errors

This goes from

  hledger: user error ("ParseError {errorPos = SourcePos {sourceName = \"foo.csv.rules\",
  sourceLine = Pos 20, sourceColumn = Pos 1} :| [], errorUnexpected =
  fromList [Tokens (' ' :| \"\")], errorExpected = fromList [Label ('b' :| \"lank or comment
  line\"),EndOfInput], errorCustom = fromList []}")

to

  hledger: user error (foo.csv.rules:20:1:
  unexpected space
  expecting blank or comment line or end of input
  )

* csv rules: Fix parsing of empty field values

A single line containing `account1 ` (note the space at the end) should
parse as assignment of the empty string to account1. At least it did
until commit 4141067.

The problem is that megaparsec's `space` parses multiple space
characters as opposed to parsec. So in the example above it would
incorrectly consume the newline.

This commit also adds a new test case for this bug.
2016-09-25 12:56:28 -07:00
..
Common.hs lib: fix ghc 8 warnings in Read.Common 2016-09-05 14:31:56 -07:00
CsvReader.hs Fix csv rules parsing (#407) 2016-09-25 12:56:28 -07:00
JournalReader.hs lib: non-journal formats now produce transaction ids #394 2016-08-14 12:44:19 -07:00
TimeclockReader.hs timeclock: fix order of transaction indexes #394 2016-08-14 14:50:03 -07:00
TimedotReader.hs Replace Parsec with Megaparsec (see #289) (#366) 2016-07-29 08:57:10 -07:00