lib: pushAccount -> pushDeclaredAccount

This commit is contained in:
Simon Michael 2018-09-22 21:06:29 -10:00
parent 8c18bada0c
commit 598129ad6a
2 changed files with 4 additions and 5 deletions

View File

@ -39,7 +39,7 @@ module Hledger.Read.Common (
getDefaultCommodityAndStyle,
getDefaultAmountStyle,
getAmountStyle,
pushAccount,
pushDeclaredAccount,
pushParentAccount,
popParentAccount,
getParentAccount,
@ -265,8 +265,8 @@ getAmountStyle commodity = do
let effectiveStyle = listToMaybe $ catMaybes [specificStyle, defaultStyle]
return effectiveStyle
pushAccount :: AccountName -> JournalParser m ()
pushAccount acct = modify' (\j -> j{jdeclaredaccounts = (acct, Nothing) : jdeclaredaccounts j})
pushDeclaredAccount :: AccountName -> JournalParser m ()
pushDeclaredAccount acct = modify' (\j -> j{jdeclaredaccounts = acct : jdeclaredaccounts j})
pushParentAccount :: AccountName -> JournalParser m ()
pushParentAccount acct = modify' (\j -> j{jparseparentaccounts = acct : jparseparentaccounts j})

View File

@ -265,8 +265,7 @@ accountdirectivep = do
let macode :: Maybe AccountCode = read <$> macode'
newline
skipMany indentedlinep
modify' (\j -> j{jdeclaredaccounts = (acct, macode) : jdeclaredaccounts j})
pushDeclaredAccount acct
indentedlinep :: JournalParser m String
indentedlinep = lift (skipSome spacenonewline) >> (rstrip <$> lift restofline)