butcher 1.3.2.1 → 1.3.2.2
raw patch · 3 files changed
+25/−17 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +5/−0
- butcher.cabal +3/−3
- src/UI/Butcher/Monadic/Internal/Core.hs +17/−14
ChangeLog.md view
@@ -1,5 +1,10 @@ # Revision history for butcher +## 1.3.2.2 -- December 2018++* Fix too-shallow descriptions on siblings for partial parses returned+ for interactive usage+ ## 1.3.2.1 -- October 2018 * Adapt/Use latest version of `deque` to fix ghc-8.6 problems
butcher.cabal view
@@ -1,12 +1,12 @@ name: butcher-version: 1.3.2.1+version: 1.3.2.2 synopsis: Chops a command or program invocation into digestable pieces. description: See the <https://github.com/lspitzner/butcher/blob/master/README.md README> (it is properly formatted on github). license: BSD3 license-file: LICENSE author: Lennart Spitzner maintainer: Lennart Spitzner <hexagoxel@hexagoxel.de>-copyright: Copyright (C) 2016-2018 Lennart Spitzner+copyright: Copyright (C) 2016-2019 Lennart Spitzner category: UI build-type: Simple Stability: experimental@@ -50,7 +50,7 @@ , extra <1.7 , void <0.8 , bifunctors <5.6- , deque >=0.2.4 && <0.3+ , deque >=0.2.4 && <0.5 } hs-source-dirs: src default-language: Haskell2010
src/UI/Butcher/Monadic/Internal/Core.hs view
@@ -732,28 +732,31 @@ Just $ (Just name, child, act, vis, InputArgs strr) (Nothing, _) -> Just $ (Nothing, child, act, vis, input) _ -> Nothing+ combined_child_list `forM_` \(child_name, (vis, child, _)) -> do+ let initialDesc :: CommandDesc out = emptyCommandDesc+ -- get the shallow desc for the child in a separate env.+ let (subCmd, subStack) =+ runIdentity+ $ MultiRWSS.runMultiRWSTNil+ $ MultiRWSS.withMultiStateSA initialDesc+ $ MultiRWSS.withMultiStateS (StackBottom mempty)+ $ iterM processCmdShallow child+ cmd_children %=+ Deque.snoc+ ( child_name+ , postProcessCmd subStack subCmd { _cmd_visibility = vis }+ ) case mRest of Nothing -> do -- a child not matching what we have in the input- let initialDesc :: CommandDesc out = emptyCommandDesc -- get the shallow desc for the child in a separate env.- combined_child_list `forM_` \(child_name, (vis, child, _)) -> do- let (subCmd, subStack) =- runIdentity- $ MultiRWSS.runMultiRWSTNil- $ MultiRWSS.withMultiStateSA initialDesc- $ MultiRWSS.withMultiStateS (StackBottom mempty)- $ iterM processCmdShallow child- cmd_children %=+ Deque.snoc- ( child_name- , postProcessCmd subStack subCmd { _cmd_visibility = vis }- ) -- proceed regularly on the same layer processMain $ restCmdParser Just (name, vis, child, act, rest) -> do -- matching child -> descend -- process all remaining stuff on the same layer shallowly,- -- including the current node. This will be replaced later.+ -- including the current node. This will walk over the child+ -- definition(s) again, but that is harmless because we do not+ -- overwrite them. iterM processCmdShallow f- -- so the descend+ -- do the descend cmd <- do c :: CommandDesc out <- mGet prevStack :: CmdDescStack <- mGet