cleanups
This commit is contained in:
parent
83e58501fc
commit
dff086a69d
@ -104,7 +104,7 @@ filterLedgerEntriesByDate begin end (RawLedger ms ps es f) =
|
|||||||
-- | Remove entries which have no transactions.
|
-- | Remove entries which have no transactions.
|
||||||
filterEmptyLedgerEntries :: RawLedger -> RawLedger
|
filterEmptyLedgerEntries :: RawLedger -> RawLedger
|
||||||
filterEmptyLedgerEntries (RawLedger ms ps es f) =
|
filterEmptyLedgerEntries (RawLedger ms ps es f) =
|
||||||
RawLedger ms ps (filter ((> 0) . length . etransactions) es) f
|
RawLedger ms ps (filter (not . null . etransactions) es) f
|
||||||
|
|
||||||
-- | In each ledger entry, filter out transactions which do not match the
|
-- | In each ledger entry, filter out transactions which do not match the
|
||||||
-- account pattern. Entries are no longer balanced after this.
|
-- account pattern. Entries are no longer balanced after this.
|
||||||
|
|||||||
@ -268,7 +268,7 @@ ledgeraccountname = do
|
|||||||
accountnamechar = alphaNum <|> oneOf ":/_" <?> "account name character"
|
accountnamechar = alphaNum <|> oneOf ":/_" <?> "account name character"
|
||||||
singlespace = try (do {spacenonewline; do {notFollowedBy spacenonewline; return ' '}})
|
singlespace = try (do {spacenonewline; do {notFollowedBy spacenonewline; return ' '}})
|
||||||
-- couldn't avoid consuming a final space sometimes, harmless
|
-- couldn't avoid consuming a final space sometimes, harmless
|
||||||
striptrailingspace s = if last s == ' ' then take (length s - 1) s else s
|
striptrailingspace s = if last s == ' ' then init s else s
|
||||||
|
|
||||||
ledgeramount :: Parser Amount
|
ledgeramount :: Parser Amount
|
||||||
ledgeramount =
|
ledgeramount =
|
||||||
|
|||||||
@ -107,7 +107,7 @@ endDateFromOpts opts =
|
|||||||
|
|
||||||
-- | Gather any ledger-style account/description pattern arguments into
|
-- | Gather any ledger-style account/description pattern arguments into
|
||||||
-- two lists. These are 0 or more account patterns optionally followed by
|
-- two lists. These are 0 or more account patterns optionally followed by
|
||||||
-- 0 or more description patterns.
|
-- -- and 0 or more description patterns.
|
||||||
parseAccountDescriptionArgs :: [String] -> ([String],[String])
|
parseAccountDescriptionArgs :: [String] -> ([String],[String])
|
||||||
parseAccountDescriptionArgs args = (as, ds')
|
parseAccountDescriptionArgs args = (as, ds')
|
||||||
where (as, ds) = break (=="--") args
|
where (as, ds) = break (=="--") args
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user