mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-09-18 17:56:55 +08:00
Remove unnecessary Maybe from isQuoteFreeElement
This commit is contained in:
@@ -293,15 +293,15 @@ isQuoteFree = isQuoteFreeNode False
|
|||||||
|
|
||||||
|
|
||||||
isQuoteFreeNode strict tree t =
|
isQuoteFreeNode strict tree t =
|
||||||
(isQuoteFreeElement t == Just True) ||
|
isQuoteFreeElement t ||
|
||||||
headOrDefault False (mapMaybe isQuoteFreeContext (drop 1 $ getPath tree t))
|
headOrDefault False (mapMaybe isQuoteFreeContext (drop 1 $ getPath tree t))
|
||||||
where
|
where
|
||||||
-- Is this node self-quoting in itself?
|
-- Is this node self-quoting in itself?
|
||||||
isQuoteFreeElement t =
|
isQuoteFreeElement t =
|
||||||
case t of
|
case t of
|
||||||
T_Assignment {} -> return True
|
T_Assignment {} -> True
|
||||||
T_FdRedirect {} -> return True
|
T_FdRedirect {} -> True
|
||||||
_ -> Nothing
|
_ -> False
|
||||||
|
|
||||||
-- Are any subnodes inherently self-quoting?
|
-- Are any subnodes inherently self-quoting?
|
||||||
isQuoteFreeContext t =
|
isQuoteFreeContext t =
|
||||||
|
Reference in New Issue
Block a user