bracketed posting date syntax is not working #304

simonmichael opened this Issue Nov 29, 2015 · 1 comment


None yet

1 participant

simonmichael commented Nov 29, 2015 edited

The docs say you can set posting dates with a Ledger-style ; [DATE] comment but that seems to be having no effect.


Ledger still supports this, but in the current manual I only find this example:

See also these related forms:

@simonmichael simonmichael added a commit that referenced this issue Apr 28, 2016
@simonmichael 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment