lib: ledger reader debug logging, cleanup
This commit is contained in:
parent
27dd1ca593
commit
48b0d8a395
@ -41,7 +41,7 @@ import qualified Filesystem.Path.CurrentOS as F
|
|||||||
|
|
||||||
import Hledger.Data
|
import Hledger.Data
|
||||||
import Hledger.Read.Common
|
import Hledger.Read.Common
|
||||||
-- import Hledger.Utils
|
import Hledger.Utils
|
||||||
import Ledger.Parser.Text
|
import Ledger.Parser.Text
|
||||||
import Text.Trifecta.Result (Result(..))
|
import Text.Trifecta.Result (Result(..))
|
||||||
|
|
||||||
@ -73,17 +73,15 @@ parse _mrulespath assrt path txt = do
|
|||||||
case r of
|
case r of
|
||||||
Failure ei -> throwError $ show ei
|
Failure ei -> throwError $ show ei
|
||||||
Success res -> do
|
Success res -> do
|
||||||
-- liftIO $ putStrLn $ show res
|
-- dbg7IO "raw entities" res
|
||||||
pj <- liftIO $ foldM journalAddRawEntityInSitu nulljournal res
|
pj <- liftIO $ foldM journalAddRawEntityInSitu nulljournal res
|
||||||
-- journalFinalise :: ClockTime -> FilePath -> Text -> Bool -> ParsedJournal -> Either String Journal
|
|
||||||
t <- liftIO getClockTime
|
t <- liftIO getClockTime
|
||||||
either throwError return $
|
either throwError return $ journalFinalise t path txt assrt pj
|
||||||
journalFinalise t path txt assrt pj
|
|
||||||
|
|
||||||
journalAddRawEntityInSitu :: ParsedJournal -> RawEntityInSitu -> IO ParsedJournal
|
journalAddRawEntityInSitu :: ParsedJournal -> RawEntityInSitu -> IO ParsedJournal
|
||||||
journalAddRawEntityInSitu
|
journalAddRawEntityInSitu
|
||||||
j
|
j
|
||||||
RawEntityInSitu{rawEntity=RawTransactionEntity (RawTransaction{
|
RawEntityInSitu{rawEntity=RawTransactionEntity (rt@RawTransaction{
|
||||||
rawTxnDate = date -- :: !String
|
rawTxnDate = date -- :: !String
|
||||||
, rawTxnDateAux = mdate2 -- :: Maybe String
|
, rawTxnDateAux = mdate2 -- :: Maybe String
|
||||||
, rawTxnState = _mstatus -- :: Maybe Char
|
, rawTxnState = _mstatus -- :: Maybe Char
|
||||||
@ -107,6 +105,8 @@ journalAddRawEntityInSitu
|
|||||||
, tpostings = ps -- :: [Posting], -- ^ this transaction's postings
|
, tpostings = ps -- :: [Posting], -- ^ this transaction's postings
|
||||||
-- tpreceding_comment_lines -- :: Text -- ^ any comment lines immediately preceding this transaction
|
-- tpreceding_comment_lines -- :: Text -- ^ any comment lines immediately preceding this transaction
|
||||||
}
|
}
|
||||||
|
dbg7IO "raw transaction" rt
|
||||||
|
dbg7IO "cooked transaction" t
|
||||||
return $ addTransaction t j
|
return $ addTransaction t j
|
||||||
|
|
||||||
journalAddRawEntityInSitu j _ = return j
|
journalAddRawEntityInSitu j _ = return j
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user