hledger/tests/journal
Simon Michael 856c0b3042 lib: fix bracketed posting dates, parser cleanup (#304)
Bracketed posting dates were fragile; they worked only if you wrote full
10-character dates. Also some semantics were a bit unclear. Now they
should be robust, and have been documented more clearly. This is a
legacy undocumented Ledger syntax, but it improves compatibility and
might be preferable to the more verbose "date:" tags if you write
posting dates often (as I do).

Internally, bracketed posting dates are no longer considered to be tags.
Journal comment, tag, and posting date parsers have been reworked, all
with doctests. Also the journal parser types generally have been
tightened up and clarified, making it much easier to know how to combine
and run them. There's now

-- | A parser of strings with generic user state, monad and return type.
type StringParser u m a = ParsecT String u m a

-- | A string parser with journal-parsing state.
type JournalParser m a = StringParser JournalContext m a

-- | A journal parser that runs in IO and can throw an error mid-parse.
type ErroringJournalParser a = JournalParser (ExceptT String IO) a

and corresponding convenience functions (and short aliases) for running them.
2016-04-28 13:34:57 -07:00
..
balance-assertions.test lib: fix balance assertion test 2016-02-19 17:52:40 -08:00
blank-description.test tests: make functional tests use "hledger" again 2015-07-12 12:29:53 -07:00
comments.test tests: make functional tests use "hledger" again 2015-07-12 12:29:53 -07:00
commodities.test consolidate some journal format-specific tests 2015-11-22 08:55:29 -08:00
dates.test lib: fix bracketed posting dates, parser cleanup (#304) 2016-04-28 13:34:57 -07:00
default-commodity.test tests: make functional tests use "hledger" again 2015-07-12 12:29:53 -07:00
directives.test journal: parse account directives 2016-04-04 11:35:39 -07:00
include.test tests: make functional tests use "hledger" again 2015-07-12 12:29:53 -07:00
market-prices.test clean up price tests 2015-11-22 08:37:02 -08:00
parens-in-account-name.test tests: make functional tests use "hledger" again 2015-07-12 12:29:53 -07:00
parse-sample-journal.test tests: make functional tests use "hledger" again 2015-07-12 12:29:53 -07:00
posting-dates.test lib: fix bracketed posting dates, parser cleanup (#304) 2016-04-28 13:34:57 -07:00
precision.test fix two failing tests 2016-02-19 21:45:39 -08:00
status.test tests: make functional tests use "hledger" again 2015-07-12 12:29:53 -07:00
tags.test lib: fix bracketed posting dates, parser cleanup (#304) 2016-04-28 13:34:57 -07:00
transaction-prices.test clean up price tests 2015-11-22 08:37:02 -08:00
unbalanced.test tests: make functional tests use "hledger" again 2015-07-12 12:29:53 -07:00
virtual-postings.test consolidate some journal format-specific tests 2015-11-22 08:55:29 -08:00