journal: allow journal entries with no postings

We now parse, and also print, posting-less journal entries, as I
proposed on the lists.

These are not real General Journal entries/transactions, but here is my
rationale:

- Ledger and beancount parse them
- if we parse them, we should print them
- they provide a natural way to record and report non-transaction events
- most of all, they permit more gradual introduction and learning of the concepts.
  Eg a beginner can keep a simple journal even before learning about accounts and postings.
This commit is contained in:
Simon Michael 2015-06-11 09:59:07 -07:00
parent 049baed4d8
commit d1769d9d62

View File

@ -550,7 +550,7 @@ codep = try (do { many1 spacenonewline; char '(' <?> "codep"; code <- anyChar `m
-- Parse the following whitespace-beginning lines as postings, posting tags, and/or comments.
postings :: Stream [Char] m Char => ParsecT [Char] JournalContext m [Posting]
postings = many1 (try postingp) <?> "postings"
postings = many (try postingp) <?> "postings"
-- linebeginningwithspaces :: Stream [Char] m Char => ParsecT [Char] JournalContext m String
-- linebeginningwithspaces = do