hledger/hledger-lib
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
..
doc doc: journal: fix posting dates link (fixes #401) 2016-09-14 06:57:44 -07:00
Hledger Fix csv rules parsing (#407) 2016-09-25 12:56:28 -07:00
tests lib: search all .hs files for doctests 2016-06-06 19:45:59 -07:00
.ghci tools: .ghci for each package, sets shorter prompt 2016-04-15 16:06:45 -07:00
CHANGES doc: add release date to changelogs 2015-10-30 14:09:19 -07:00
hledger-lib.cabal lib, cli, web: try to fix building with GHC 7.4 2016-08-09 12:22:38 -07:00
Hledger.hs prettify/hlint 2016-02-20 20:12:02 -08:00
LICENSE split off hledger-lib package, containing core types & utils 2010-03-22 01:44:59 +00:00
package.yaml lib, cli, web: try to fix building with GHC 7.4 2016-08-09 12:22:38 -07:00
README doc: ensure all five main packages have a README 2016-04-12 11:13:01 -07:00
Setup.hs Revert "remove Setup.hs files again, fixing a yesod devel warning" 2014-05-24 13:39:09 -07:00

A reusable library containing hledger's core functionality.
This is used by most hledger* packages for common data parsing,
command line option handling, reporting etc.