mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-16 10:03:08 -07:00
Implement getPath in terms of unfoldr
This commit is contained in:
parent
980e7d3ca8
commit
e1ad063834
1 changed files with 3 additions and 4 deletions
|
@ -897,10 +897,9 @@ getUnmodifiedParameterExpansion t =
|
|||
_ -> Nothing
|
||||
|
||||
--- A list of the element and all its parents up to the root node.
|
||||
getPath tree t = t :
|
||||
case Map.lookup (getId t) tree of
|
||||
Nothing -> []
|
||||
Just parent -> getPath tree parent
|
||||
getPath tree t = t : unfoldr go t
|
||||
where
|
||||
go s = (\x -> (x,x)) <$> Map.lookup (getId s) tree
|
||||
|
||||
isClosingFileOp op =
|
||||
case op of
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue