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.
This commit is contained in:
Simon Michael 2018-07-26 15:54:21 +01:00
parent e2f5e98926
commit d9d94e2cf6

View File

@ -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