From eb235049069b7ca2feb625d0b825ef4a72d15b1e Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 12 Jun 2018 16:39:17 -0700 Subject: [PATCH] lib: periodexprp: don't consume trailing whitespace --- hledger-lib/Hledger/Data/Dates.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hledger-lib/Hledger/Data/Dates.hs b/hledger-lib/Hledger/Data/Dates.hs index 33ecaeef6..dd34898a3 100644 --- a/hledger-lib/Hledger/Data/Dates.hs +++ b/hledger-lib/Hledger/Data/Dates.hs @@ -919,7 +919,9 @@ lastthisnextthing = do -- >>> p "every 2nd day of month 2009-" -- Right (DayOfMonth 2,DateSpan 2009/01/01-) periodexprp :: Day -> TextParser m (Interval, DateSpan) -periodexprp rdate = surroundedBy (skipMany spacenonewline) . choice $ map try [ +periodexprp rdate = do + skipMany spacenonewline + choice $ map try [ intervalanddateperiodexprp rdate, (,) NoInterval <$> periodexprdatespanp rdate ]