imp:journal: in amounts, also allow and ignore empty {} (or {{}})

This commit is contained in:
Simon Michael 2025-09-08 18:55:29 +01:00
parent eb9fa40d5b
commit 6d164b48a0

View File

@ -1025,7 +1025,7 @@ balanceassertionp = do
}
-- Parse a Ledger-style lot cost,
-- {UNITCOST} or {{TOTALCOST}} or {=FIXEDUNITCOST} or {{=FIXEDTOTALCOST}},
-- {UNITCOST} or {{TOTALCOST}} or {=FIXEDUNITCOST} or {{=FIXEDTOTALCOST}} or {},
-- and discard it.
lotcostp :: JournalParser m ()
lotcostp =
@ -1036,7 +1036,7 @@ lotcostp =
lift skipNonNewlineSpaces
_fixed <- fmap isJust $ optional $ char '='
lift skipNonNewlineSpaces
_a <- simpleamountp False
_a <- option 0 $ simpleamountp False
lift skipNonNewlineSpaces
char '}'
when (doublebrace) $ void $ char '}'