mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-09-24 04:59:34 +08:00
Simplify getSpecial
This commit is contained in:
@@ -826,9 +826,8 @@ getBracedReference s = fromMaybe s $
|
|||||||
let name = takeWhile isVariableChar s
|
let name = takeWhile isVariableChar s
|
||||||
guard . not $ null name
|
guard . not $ null name
|
||||||
return name
|
return name
|
||||||
getSpecial (c:_) =
|
getSpecial (c:_) | c `elem` "*@#?-$!" = return [c]
|
||||||
if c `elem` "*@#?-$!" then return [c] else fail "not special"
|
getSpecial _ = fail "empty or not special"
|
||||||
getSpecial _ = fail "empty"
|
|
||||||
|
|
||||||
nameExpansion ('!':rest) = do -- e.g. ${!foo*bar*}
|
nameExpansion ('!':rest) = do -- e.g. ${!foo*bar*}
|
||||||
let suffix = dropWhile isVariableChar rest
|
let suffix = dropWhile isVariableChar rest
|
||||||
|
Reference in New Issue
Block a user