From 04c35e1519840831c36563dc6e1db32f10beb534 Mon Sep 17 00:00:00 2001 From: Stephen Morgan Date: Wed, 8 Sep 2021 20:50:23 +1000 Subject: [PATCH] fix: bin: Allow hledger-check-fancyassertions to parse predicates (#1464). --- bin/hledger-check-fancyassertions.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/hledger-check-fancyassertions.hs b/bin/hledger-check-fancyassertions.hs index 1d5d6238c..cea35b1da 100755 --- a/bin/hledger-check-fancyassertions.hs +++ b/bin/hledger-check-fancyassertions.hs @@ -459,7 +459,7 @@ data Value = Account H.AccountName | AccountNested H.AccountName | Amount H.Amou -- | Parse a 'Value'. valuep :: Monad m => H.JournalParser m Value -- Account name parser has to come last because they eat everything. -valuep = valueamountp <|> valueaccountnestedp <|> valueaccountp where +valuep = P.try valueamountp <|> P.try valueaccountnestedp <|> valueaccountp where valueamountp = Amount <$> H.amountp valueaccountp = Account <$> lift H.accountnamep valueaccountnestedp = AccountNested <$> (P.char '*' *> spaces *> lift H.accountnamep)