allow extra whitespace and comments at end of ledger
This commit is contained in:
parent
1607661b87
commit
a49b9715ef
@ -171,14 +171,14 @@ ledger = do
|
||||
modifier_entries <- many ledgermodifierentry
|
||||
periodic_entries <- many ledgerperiodicentry
|
||||
|
||||
entries <- (many ledgerentry) <?> "entry"
|
||||
entries <- (many $ try ledgerentry) <?> "entry"
|
||||
final_comment_lines <- ledgernondatalines
|
||||
eof
|
||||
return $ RawLedger modifier_entries periodic_entries entries (unlines final_comment_lines)
|
||||
|
||||
ledgernondatalines :: Parser [String]
|
||||
ledgernondatalines = many (ledgerdirective <|> -- treat as comments
|
||||
commentline <|>
|
||||
ledgernondatalines = many (try ledgerdirective <|> -- treat as comments
|
||||
try commentline <|>
|
||||
blankline)
|
||||
|
||||
ledgerdirective :: Parser String
|
||||
|
||||
2
NOTES
2
NOTES
@ -6,8 +6,6 @@ implementations were its consequences." --Niklaus Wirth
|
||||
|
||||
* to do
|
||||
** errors
|
||||
*** ? in description or amount gives "too many blank transactions"
|
||||
*** parse commented lines at end of file
|
||||
*** display mixed amounts vertically, not horizontally
|
||||
** features
|
||||
*** flexible date expressions, for easier time reports
|
||||
|
||||
@ -34,3 +34,6 @@
|
||||
2008/1/1 * pay off
|
||||
liabilities:debts $1
|
||||
assets:checking
|
||||
|
||||
|
||||
;final comment
|
||||
|
||||
Loading…
Reference in New Issue
Block a user