hledger/hledger-lib/Hledger
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
..
Data lib: debug utils cleanup 2016-09-06 08:31:53 -07:00
Read Fix csv rules parsing (#407) 2016-09-25 12:56:28 -07:00
Reports ui, lib: another historical balance fix for accountTransactionsReport 2016-09-06 08:43:25 -07:00
Utils lib: debug utils cleanup 2016-09-06 08:31:53 -07:00
Data.hs lib: Period, a richer period type 2016-07-29 10:27:30 -07:00
Query.hs lib: more history awareness for account transactions report #392 2016-08-08 17:25:42 -07:00
Read.hs lib: fix tests; always try parsing stdin as journal 2016-05-24 19:00:58 -07:00
Reports.hs BalanceHistoryReport is not used 2016-08-08 07:11:16 -07:00
Utils.hs Replace Parsec with Megaparsec (see #289) (#366) 2016-07-29 08:57:10 -07:00