Simplify getSpecial

This commit is contained in:
Joseph C. Sible 2020-04-05 16:21:07 -04:00
parent 1cf0aa25e9
commit ca41440a67
1 changed files with 2 additions and 3 deletions

View File

@ -826,9 +826,8 @@ getBracedReference s = fromMaybe s $
let name = takeWhile isVariableChar s
guard . not $ null name
return name
getSpecial (c:_) =
if c `elem` "*@#?-$!" then return [c] else fail "not special"
getSpecial _ = fail "empty"
getSpecial (c:_) | c `elem` "*@#?-$!" = return [c]
getSpecial _ = fail "empty or not special"
nameExpansion ('!':rest) = do -- e.g. ${!foo*bar*}
let suffix = dropWhile isVariableChar rest