lib: minor cleanup in 'periodictransactionp'

This commit is contained in:
Alex Chen 2018-11-22 14:05:38 -07:00 committed by Simon Michael
parent 519297051d
commit 83a63a4ef5

View File

@ -533,17 +533,14 @@ periodictransactionp = do
Nothing -> pure ()
-- The line can end here, or it can continue with one or more spaces
-- and then zero or more of the following fields. A bit awkward.
(status, code, description, (comment, tags)) <-
(lift eolof >> return (Unmarked, "", "", ("", [])))
<|>
(do
lift $ skipSome spacenonewline
s <- lift statusp
c <- lift codep
desc <- lift $ T.strip <$> descriptionp
(cmt, ts) <- lift transactioncommentp
(status, code, description, (comment, tags)) <- lift $
(<|>) (eolof >> return (Unmarked, "", "", ("", []))) $ do
skipSome spacenonewline
s <- statusp
c <- codep
desc <- T.strip <$> descriptionp
(cmt, ts) <- transactioncommentp
return (s,c,desc,(cmt,ts))
)
-- next lines; use same year determined above
postings <- postingsp (Just $ first3 $ toGregorian refdate)