From 32a3af8334960473701e911d91c463ca35283686 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 7 Apr 2009 21:18:51 +0000 Subject: [PATCH] transactionamount -> postingamount --- Ledger/Parse.hs | 10 +++++----- Tests.hs | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Ledger/Parse.hs b/Ledger/Parse.hs index c37b568a6..47b61b187 100644 --- a/Ledger/Parse.hs +++ b/Ledger/Parse.hs @@ -368,7 +368,7 @@ normalposting :: GenParser Char LedgerFileCtx Posting normalposting = do status <- ledgerstatus account <- transactionaccountname - amount <- transactionamount + amount <- postingamount many spacenonewline comment <- ledgercomment restofline @@ -381,7 +381,7 @@ virtualposting = do char '(' account <- transactionaccountname char ')' - amount <- transactionamount + amount <- postingamount many spacenonewline comment <- ledgercomment restofline @@ -394,7 +394,7 @@ balancedvirtualposting = do char '[' account <- transactionaccountname char ']' - amount <- transactionamount + amount <- postingamount many spacenonewline comment <- ledgercomment restofline @@ -417,8 +417,8 @@ ledgeraccountname = do accountnamechar = notFollowedBy (oneOf "()[]") >> nonspace "account name character (non-bracket, non-parenthesis, non-whitespace)" -transactionamount :: GenParser Char st MixedAmount -transactionamount = +postingamount :: GenParser Char st MixedAmount +postingamount = try (do many1 spacenonewline a <- someamount <|> return missingamt diff --git a/Tests.hs b/Tests.hs index a821b978e..7230b4ade 100644 --- a/Tests.hs +++ b/Tests.hs @@ -734,9 +734,9 @@ tests = [ nulltxn{date=parsedate "2008/01/01",description="- 2008/12/31",account="",amount=Mixed [dollars 15]} ] - ,"transactionamount" ~: do - parseWithCtx transactionamount " $47.18" `parseis` Mixed [dollars 47.18] - parseWithCtx transactionamount " $1." `parseis` + ,"postingamount" ~: do + parseWithCtx postingamount " $47.18" `parseis` Mixed [dollars 47.18] + parseWithCtx postingamount " $1." `parseis` Mixed [Amount (Commodity {symbol="$",side=L,spaced=False,comma=False,precision=0}) 1 Nothing] ] @@ -1147,5 +1147,5 @@ rawLedgerWithAmounts as = [] [] "" - where parse = fromparse . parseWithCtx transactionamount . (" "++) + where parse = fromparse . parseWithCtx postingamount . (" "++)