diff --git a/hledger-lib/Hledger/Read/Common.hs b/hledger-lib/Hledger/Read/Common.hs index 2bd3dcd4e..e183ceea6 100644 --- a/hledger-lib/Hledger/Read/Common.hs +++ b/hledger-lib/Hledger/Read/Common.hs @@ -45,7 +45,7 @@ module Hledger.Read.Common ( journalSourcePos, parseAndFinaliseJournal, parseAndFinaliseJournal', - finaliseJournal, + journalFinalise, setYear, getYear, setDefaultCommodityAndStyle, @@ -260,7 +260,7 @@ parseAndFinaliseJournal parser iopts f txt = do Left finalParseError -> throwError $ finalErrorBundlePretty $ attachSource f txt finalParseError Right ep -> case ep of Left e -> throwError $ customErrorBundlePretty e - Right pj -> finaliseJournal iopts f txt pj + Right pj -> journalFinalise iopts f txt pj -- | Like parseAndFinaliseJournal but takes a (non-Erroring) JournalParser. -- Used for timeclock/timedot. @@ -276,7 +276,7 @@ parseAndFinaliseJournal' parser iopts f txt = do -- see notes above case ep of Left e -> throwError $ customErrorBundlePretty e - Right pj -> finaliseJournal iopts f txt pj + Right pj -> journalFinalise iopts f txt pj -- | Post-process a Journal that has just been parsed or generated, in this order: -- @@ -290,8 +290,8 @@ parseAndFinaliseJournal' parser iopts f txt = do -- -- - check balance assertions if enabled. -- -finaliseJournal :: InputOpts -> FilePath -> Text -> Journal -> ExceptT String IO Journal -finaliseJournal iopts f txt pj = do +journalFinalise :: InputOpts -> FilePath -> Text -> Journal -> ExceptT String IO Journal +journalFinalise iopts f txt pj = do t <- liftIO getClockTime -- Infer and apply canonical styles for each commodity (or fail). -- This affects transaction balancing/assertions/assignments, so needs to be done early. diff --git a/hledger-lib/Hledger/Read/CsvReader.hs b/hledger-lib/Hledger/Read/CsvReader.hs index 6600c8fe4..9c1256a51 100644 --- a/hledger-lib/Hledger/Read/CsvReader.hs +++ b/hledger-lib/Hledger/Read/CsvReader.hs @@ -81,7 +81,7 @@ import Text.Printf (printf) import Hledger.Data import Hledger.Utils -import Hledger.Read.Common (Reader(..),InputOpts(..),amountp, statusp, genericSourcePos, finaliseJournal) +import Hledger.Read.Common (Reader(..),InputOpts(..),amountp, statusp, genericSourcePos, journalFinalise) --- ** doctest setup -- $setup @@ -111,9 +111,9 @@ parse iopts f t = do let rulesfile = mrules_file_ iopts r <- liftIO $ readJournalFromCsv rulesfile f t case r of Left e -> throwError e - Right pj -> finaliseJournal iopts{ignore_assertions_=True} f t pj' + Right pj -> journalFinalise iopts{ignore_assertions_=True} f t pj' where - -- finaliseJournal assumes the journal's items are + -- journalFinalise assumes the journal's items are -- reversed, as produced by JournalReader's parser. -- But here they are already properly ordered. So we'd -- better preemptively reverse them once more. XXX inefficient