From 6c2385331c9ba00c7e329e70546615c455502f51 Mon Sep 17 00:00:00 2001 From: Stephen Morgan Date: Tue, 15 May 2018 10:50:35 +1000 Subject: [PATCH] Allow comments for periodic transactions. --- hledger-lib/Hledger/Read/JournalReader.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hledger-lib/Hledger/Read/JournalReader.hs b/hledger-lib/Hledger/Read/JournalReader.hs index 40bb5110b..9cb5643c0 100644 --- a/hledger-lib/Hledger/Read/JournalReader.hs +++ b/hledger-lib/Hledger/Read/JournalReader.hs @@ -457,11 +457,13 @@ modifiertransactionp = do postings <- postingsp Nothing return $ ModifierTransaction valueexpr postings +-- | Parse a periodic transaction periodictransactionp :: MonadIO m => ErroringJournalParser m PeriodicTransaction periodictransactionp = do char '~' "periodic transaction" lift (skipMany spacenonewline) - periodexpr <- T.pack <$> lift restofline + periodexpr <- T.pack . strip <$> descriptionp + _ <- try followingcommentp <|> (newline >> return "") postings <- postingsp Nothing return $ PeriodicTransaction periodexpr postings