mirror of
https://github.com/simonmichael/hledger.git
synced 2024-09-20 02:37:12 +03:00
;lib: add 'payee' directive
This commit is contained in:
parent
8ab2316604
commit
e092b38631
@ -226,6 +226,7 @@ directivep = (do
|
||||
,applyaccountdirectivep
|
||||
,commoditydirectivep
|
||||
,endapplyaccountdirectivep
|
||||
,payeedirectivep
|
||||
,tagdirectivep
|
||||
,endtagdirectivep
|
||||
,defaultyeardirectivep
|
||||
@ -519,6 +520,14 @@ endtagdirectivep = do
|
||||
lift restofline
|
||||
return ()
|
||||
|
||||
payeedirectivep :: JournalParser m ()
|
||||
payeedirectivep = do
|
||||
string "payee" <?> "payee directive"
|
||||
lift skipNonNewlineSpaces1
|
||||
_ <- lift $ some nonspace
|
||||
lift restofline
|
||||
return ()
|
||||
|
||||
defaultyeardirectivep :: JournalParser m ()
|
||||
defaultyeardirectivep = do
|
||||
char 'Y' <?> "default year"
|
||||
@ -985,6 +994,11 @@ tests_JournalReader = tests "JournalReader" [
|
||||
pdamount = usd 922.83
|
||||
}
|
||||
|
||||
,tests "payeedirectivep" [
|
||||
test "simple" $ assertParse payeedirectivep "payee foo\n"
|
||||
,test "with-comment" $ assertParse payeedirectivep "payee foo ; comment\n"
|
||||
]
|
||||
|
||||
,test "tagdirectivep" $ do
|
||||
assertParse tagdirectivep "tag foo \n"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user