Fix too-shallow descs for "siblings"
parent
6e70709e67
commit
593d903a53
|
@ -732,11 +732,9 @@ runCmdParserAExt mTopLevel inputInitial cmdParser =
|
||||||
Just $ (Just name, child, act, vis, InputArgs strr)
|
Just $ (Just name, child, act, vis, InputArgs strr)
|
||||||
(Nothing, _) -> Just $ (Nothing, child, act, vis, input)
|
(Nothing, _) -> Just $ (Nothing, child, act, vis, input)
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
case mRest of
|
combined_child_list `forM_` \(child_name, (vis, child, _)) -> do
|
||||||
Nothing -> do -- a child not matching what we have in the input
|
|
||||||
let initialDesc :: CommandDesc out = emptyCommandDesc
|
let initialDesc :: CommandDesc out = emptyCommandDesc
|
||||||
-- get the shallow desc for the child in a separate env.
|
-- get the shallow desc for the child in a separate env.
|
||||||
combined_child_list `forM_` \(child_name, (vis, child, _)) -> do
|
|
||||||
let (subCmd, subStack) =
|
let (subCmd, subStack) =
|
||||||
runIdentity
|
runIdentity
|
||||||
$ MultiRWSS.runMultiRWSTNil
|
$ MultiRWSS.runMultiRWSTNil
|
||||||
|
@ -747,13 +745,18 @@ runCmdParserAExt mTopLevel inputInitial cmdParser =
|
||||||
( child_name
|
( child_name
|
||||||
, postProcessCmd subStack subCmd { _cmd_visibility = vis }
|
, postProcessCmd subStack subCmd { _cmd_visibility = vis }
|
||||||
)
|
)
|
||||||
|
case mRest of
|
||||||
|
Nothing -> do -- a child not matching what we have in the input
|
||||||
|
-- get the shallow desc for the child in a separate env.
|
||||||
-- proceed regularly on the same layer
|
-- proceed regularly on the same layer
|
||||||
processMain $ restCmdParser
|
processMain $ restCmdParser
|
||||||
Just (name, vis, child, act, rest) -> do -- matching child -> descend
|
Just (name, vis, child, act, rest) -> do -- matching child -> descend
|
||||||
-- process all remaining stuff on the same layer shallowly,
|
-- 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
|
iterM processCmdShallow f
|
||||||
-- so the descend
|
-- do the descend
|
||||||
cmd <- do
|
cmd <- do
|
||||||
c :: CommandDesc out <- mGet
|
c :: CommandDesc out <- mGet
|
||||||
prevStack :: CmdDescStack <- mGet
|
prevStack :: CmdDescStack <- mGet
|
||||||
|
|
Loading…
Reference in New Issue