imp: journal: allow an empty double-quoted commodity symbol

"" is equivalent to writing no symbol.
But it's now possible to declare market prices for the no-symbol
commodity, which occurs eg with timedot data.

P 2022-01-01 "" $100
This commit is contained in:
Simon Michael 2022-12-22 01:50:37 -10:00
parent a070875fe6
commit 85e9fbcf7d
2 changed files with 2 additions and 1 deletions

View File

@ -831,7 +831,7 @@ commoditysymbolp =
quotedcommoditysymbolp :: TextParser m CommoditySymbol
quotedcommoditysymbolp =
between (char '"') (char '"') $ takeWhile1P Nothing f
between (char '"') (char '"') $ takeWhileP Nothing f
where f c = c /= ';' && c /= '\n' && c /= '\"'
simplecommoditysymbolp :: TextParser m CommoditySymbol

View File

@ -54,6 +54,7 @@ assert 1
bucket Assets:Checking
A Assets:Checking
C $1 = USD 1
C 1 "" = $1
capture Expenses:Deductible:Medical Medical
check 1
define var_name=$100