mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-29 05:11:33 +03:00
lib: pushAccount -> pushDeclaredAccount
This commit is contained in:
parent
8c18bada0c
commit
598129ad6a
@ -39,7 +39,7 @@ module Hledger.Read.Common (
|
|||||||
getDefaultCommodityAndStyle,
|
getDefaultCommodityAndStyle,
|
||||||
getDefaultAmountStyle,
|
getDefaultAmountStyle,
|
||||||
getAmountStyle,
|
getAmountStyle,
|
||||||
pushAccount,
|
pushDeclaredAccount,
|
||||||
pushParentAccount,
|
pushParentAccount,
|
||||||
popParentAccount,
|
popParentAccount,
|
||||||
getParentAccount,
|
getParentAccount,
|
||||||
@ -265,8 +265,8 @@ getAmountStyle commodity = do
|
|||||||
let effectiveStyle = listToMaybe $ catMaybes [specificStyle, defaultStyle]
|
let effectiveStyle = listToMaybe $ catMaybes [specificStyle, defaultStyle]
|
||||||
return effectiveStyle
|
return effectiveStyle
|
||||||
|
|
||||||
pushAccount :: AccountName -> JournalParser m ()
|
pushDeclaredAccount :: AccountName -> JournalParser m ()
|
||||||
pushAccount acct = modify' (\j -> j{jdeclaredaccounts = (acct, Nothing) : jdeclaredaccounts j})
|
pushDeclaredAccount acct = modify' (\j -> j{jdeclaredaccounts = acct : jdeclaredaccounts j})
|
||||||
|
|
||||||
pushParentAccount :: AccountName -> JournalParser m ()
|
pushParentAccount :: AccountName -> JournalParser m ()
|
||||||
pushParentAccount acct = modify' (\j -> j{jparseparentaccounts = acct : jparseparentaccounts j})
|
pushParentAccount acct = modify' (\j -> j{jparseparentaccounts = acct : jparseparentaccounts j})
|
||||||
|
@ -265,8 +265,7 @@ accountdirectivep = do
|
|||||||
let macode :: Maybe AccountCode = read <$> macode'
|
let macode :: Maybe AccountCode = read <$> macode'
|
||||||
newline
|
newline
|
||||||
skipMany indentedlinep
|
skipMany indentedlinep
|
||||||
|
pushDeclaredAccount acct
|
||||||
modify' (\j -> j{jdeclaredaccounts = (acct, macode) : jdeclaredaccounts j})
|
|
||||||
|
|
||||||
indentedlinep :: JournalParser m String
|
indentedlinep :: JournalParser m String
|
||||||
indentedlinep = lift (skipSome spacenonewline) >> (rstrip <$> lift restofline)
|
indentedlinep = lift (skipSome spacenonewline) >> (rstrip <$> lift restofline)
|
||||||
|
Loading…
Reference in New Issue
Block a user