imp: journal: ignore python, eval directives (ledger compat)
This commit is contained in:
parent
2e77586d1b
commit
af5645ebb7
@ -248,8 +248,10 @@ directivep = (do
|
|||||||
,commoditydirectivep
|
,commoditydirectivep
|
||||||
,commodityconversiondirectivep
|
,commodityconversiondirectivep
|
||||||
,definedirectivep
|
,definedirectivep
|
||||||
|
,evaldirectivep
|
||||||
,exprdirectivep
|
,exprdirectivep
|
||||||
,payeedirectivep
|
,payeedirectivep
|
||||||
|
,pythondirectivep
|
||||||
,decimalmarkdirectivep
|
,decimalmarkdirectivep
|
||||||
,defaultyeardirectivep
|
,defaultyeardirectivep
|
||||||
,defaultcommoditydirectivep
|
,defaultcommoditydirectivep
|
||||||
@ -528,7 +530,8 @@ formatdirectivep expectedsym = do
|
|||||||
-- apply fixed, apply tag, assert, bucket, A, capture, check, define, expr
|
-- apply fixed, apply tag, assert, bucket, A, capture, check, define, expr
|
||||||
applyfixeddirectivep, applytagdirectivep, assertdirectivep, bucketdirectivep,
|
applyfixeddirectivep, applytagdirectivep, assertdirectivep, bucketdirectivep,
|
||||||
capturedirectivep, checkdirectivep, definedirectivep, exprdirectivep,
|
capturedirectivep, checkdirectivep, definedirectivep, exprdirectivep,
|
||||||
valuedirectivep, commandlineflagdirectivep :: JournalParser m ()
|
valuedirectivep, pythondirectivep, evaldirectivep, commandlineflagdirectivep
|
||||||
|
:: JournalParser m ()
|
||||||
applyfixeddirectivep = do string "apply fixed" >> lift restofline >> return ()
|
applyfixeddirectivep = do string "apply fixed" >> lift restofline >> return ()
|
||||||
applytagdirectivep = do string "apply tag" >> lift restofline >> return ()
|
applytagdirectivep = do string "apply tag" >> lift restofline >> return ()
|
||||||
assertdirectivep = do string "assert" >> lift restofline >> return ()
|
assertdirectivep = do string "assert" >> lift restofline >> return ()
|
||||||
@ -538,6 +541,10 @@ checkdirectivep = do string "check" >> lift restofline >> return ()
|
|||||||
definedirectivep = do string "define" >> lift restofline >> return ()
|
definedirectivep = do string "define" >> lift restofline >> return ()
|
||||||
exprdirectivep = do string "expr" >> lift restofline >> return ()
|
exprdirectivep = do string "expr" >> lift restofline >> return ()
|
||||||
valuedirectivep = do string "value" >> lift restofline >> return ()
|
valuedirectivep = do string "value" >> lift restofline >> return ()
|
||||||
|
pythondirectivep = do string "python" >> lift restofline >> many (indented $ lift restofline) >> return ()
|
||||||
|
where
|
||||||
|
indented = (lift skipNonNewlineSpaces1 >>)
|
||||||
|
evaldirectivep = do string "eval" >> lift restofline >> return ()
|
||||||
commandlineflagdirectivep = do string "--" >> lift restofline >> return ()
|
commandlineflagdirectivep = do string "--" >> lift restofline >> return ()
|
||||||
|
|
||||||
keywordp :: String -> JournalParser m ()
|
keywordp :: String -> JournalParser m ()
|
||||||
|
|||||||
@ -2751,6 +2751,8 @@ define VAR=EXPR
|
|||||||
expr EXPR
|
expr EXPR
|
||||||
tag NAME
|
tag NAME
|
||||||
value EXPR
|
value EXPR
|
||||||
|
python
|
||||||
|
eval EXPR
|
||||||
--command-line-flag
|
--command-line-flag
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@ -59,6 +59,9 @@ tag Receipt
|
|||||||
check value =~ /pattern/
|
check value =~ /pattern/
|
||||||
assert value != "foobar"
|
assert value != "foobar"
|
||||||
value some_func
|
value some_func
|
||||||
|
python
|
||||||
|
import os
|
||||||
|
eval foo
|
||||||
--command-line-flag
|
--command-line-flag
|
||||||
|
|
||||||
$ hledger -f- check
|
$ hledger -f- check
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user