From 97f7165656b6f5bf12f527a51f4928a73e23a2fe Mon Sep 17 00:00:00 2001 From: Lennart Spitzner Date: Tue, 16 May 2017 23:44:54 +0200 Subject: [PATCH] Fix two bugs - when input was missing inside a reorder, butcher erroneously reported an monadMisuseError; - flags that allow multiple occurences/values returned the results in the reversed order. --- src/UI/Butcher/Monadic/Internal/Core.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/UI/Butcher/Monadic/Internal/Core.hs b/src/UI/Butcher/Monadic/Internal/Core.hs index 6385396..bee4ca6 100644 --- a/src/UI/Butcher/Monadic/Internal/Core.hs +++ b/src/UI/Butcher/Monadic/Internal/Core.hs @@ -880,8 +880,7 @@ runCmdParserAExt mTopLevel inputInitial cmdParser ++ show input ] failureCurrentShallowRerun - return $ return $ monadMisuseError -- so ugly. - -- should be correct nonetheless. + processParsedParts $ nextF monadMisuseError continueOrMisuse :: Maybe p -> m (CmdParser f out a) continueOrMisuse = maybe monadMisuseError (processParsedParts . nextF) @@ -916,7 +915,7 @@ runCmdParserAExt mTopLevel inputInitial cmdParser mSet $ MapS.delete pid m let partDyns = case MapS.lookup pid m of Nothing -> [] - Just r -> r + Just r -> reverse r case mapM fromDynamic partDyns of Nothing -> monadMisuseError Just xs -> processParsedParts $ nextF xs