From d9d94e2cf61c93e24859dcccfe3e1a711d7cf860 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 26 Jul 2018 15:54:21 +0100 Subject: [PATCH] journal: fix breakage in auto posting rule parser (#745) I was negligent and did not test enough. This should ignore transaction comments in auto posting rules more safely. It also adds support for trailing comments on the first line of auto posting rules, which previously were misparsed as part of the query. --- hledger-lib/Hledger/Read/JournalReader.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hledger-lib/Hledger/Read/JournalReader.hs b/hledger-lib/Hledger/Read/JournalReader.hs index 3e223a5f9..249b33f4c 100644 --- a/hledger-lib/Hledger/Read/JournalReader.hs +++ b/hledger-lib/Hledger/Read/JournalReader.hs @@ -474,8 +474,8 @@ modifiertransactionp :: JournalParser m ModifierTransaction modifiertransactionp = do char '=' "modifier transaction" lift (skipMany spacenonewline) - querytxt <- T.pack <$> lift restofline -- TODO should not consume a same-line comment - (_cmt, _tags) <- lift transactioncommentp -- TODO apply these to modified txns ? + querytxt <- lift $ T.strip <$> descriptionp + (_comment, _tags) <- lift transactioncommentp -- TODO apply these to modified txns ? postings <- postingsp Nothing return $ ModifierTransaction querytxt postings