;lib: add 'payee' directive
This commit is contained in:
parent
8ab2316604
commit
e092b38631
@ -226,6 +226,7 @@ directivep = (do
|
|||||||
,applyaccountdirectivep
|
,applyaccountdirectivep
|
||||||
,commoditydirectivep
|
,commoditydirectivep
|
||||||
,endapplyaccountdirectivep
|
,endapplyaccountdirectivep
|
||||||
|
,payeedirectivep
|
||||||
,tagdirectivep
|
,tagdirectivep
|
||||||
,endtagdirectivep
|
,endtagdirectivep
|
||||||
,defaultyeardirectivep
|
,defaultyeardirectivep
|
||||||
@ -519,6 +520,14 @@ endtagdirectivep = do
|
|||||||
lift restofline
|
lift restofline
|
||||||
return ()
|
return ()
|
||||||
|
|
||||||
|
payeedirectivep :: JournalParser m ()
|
||||||
|
payeedirectivep = do
|
||||||
|
string "payee" <?> "payee directive"
|
||||||
|
lift skipNonNewlineSpaces1
|
||||||
|
_ <- lift $ some nonspace
|
||||||
|
lift restofline
|
||||||
|
return ()
|
||||||
|
|
||||||
defaultyeardirectivep :: JournalParser m ()
|
defaultyeardirectivep :: JournalParser m ()
|
||||||
defaultyeardirectivep = do
|
defaultyeardirectivep = do
|
||||||
char 'Y' <?> "default year"
|
char 'Y' <?> "default year"
|
||||||
@ -985,6 +994,11 @@ tests_JournalReader = tests "JournalReader" [
|
|||||||
pdamount = usd 922.83
|
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
|
,test "tagdirectivep" $ do
|
||||||
assertParse tagdirectivep "tag foo \n"
|
assertParse tagdirectivep "tag foo \n"
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user