fix: bin: Allow hledger-check-fancyassertions to parse predicates (#1464).

This commit is contained in:
Stephen Morgan 2021-09-08 20:50:23 +10:00 committed by Simon Michael
parent 8fcdc22a45
commit 04c35e1519

View File

@ -459,7 +459,7 @@ data Value = Account H.AccountName | AccountNested H.AccountName | Amount H.Amou
-- | Parse a 'Value'. -- | Parse a 'Value'.
valuep :: Monad m => H.JournalParser m Value valuep :: Monad m => H.JournalParser m Value
-- Account name parser has to come last because they eat everything. -- 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 valueamountp = Amount <$> H.amountp
valueaccountp = Account <$> lift H.accountnamep valueaccountp = Account <$> lift H.accountnamep
valueaccountnestedp = AccountNested <$> (P.char '*' *> spaces *> lift H.accountnamep) valueaccountnestedp = AccountNested <$> (P.char '*' *> spaces *> lift H.accountnamep)