lib: tabular rules separator cannot be space

This commit is contained in:
Dmitry Astapov 2020-06-22 18:12:10 +01:00 committed by Simon Michael
parent c397b90b5b
commit ed01e57b23
2 changed files with 26 additions and 1 deletions

View File

@ -569,7 +569,7 @@ conditionaltablep = do
lift $ dbgparse 8 "trying conditionaltablep"
start <- getOffset
string "if"
sep <- lift $ satisfy (not.isAlphaNum)
sep <- lift $ satisfy (\c -> not (isAlphaNum c || isSpace c))
fields <- journalfieldnamep `sepBy1` (char sep)
newline
body <- flip manyTill (lift eolof) $ do

View File

@ -857,6 +857,31 @@ $ ./csvtest.sh
>=0
# 43. Attempt to use space as a separator in the tabular rules
<
10/2009/09,Flubber Co,50
10/2009/09,Blubber Co,150
RULES
fields date, description, amount
date-format %d/%Y/%m
currency $
account1 assets:myacct
if account2 comment
%amount 150 acct2
%description Flubber acct
$ ./csvtest.sh
>2
hledger: user error (input.rules:5:1:
|
5 | if account2 comment
| ^
start of conditional block found, but no assignment rules afterward
(assignment rules in a conditional block should be indented)
)
>=1
## .
#<