Simplify getSpecial
This commit is contained in:
parent
1cf0aa25e9
commit
ca41440a67
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue