Simplify dropPrefix

This commit is contained in:
Joseph C. Sible 2020-04-05 16:19:18 -04:00
parent 4604066c37
commit 1cf0aa25e9
1 changed files with 2 additions and 2 deletions

View File

@ -820,8 +820,8 @@ getBracedReference s = fromMaybe s $
nameExpansion s `mplus` takeName noPrefix `mplus` getSpecial noPrefix `mplus` getSpecial s nameExpansion s `mplus` takeName noPrefix `mplus` getSpecial noPrefix `mplus` getSpecial s
where where
noPrefix = dropPrefix s noPrefix = dropPrefix s
dropPrefix (c:rest) = if c `elem` "!#" then rest else c:rest dropPrefix (c:rest) | c `elem` "!#" = rest
dropPrefix "" = "" dropPrefix cs = cs
takeName s = do takeName s = do
let name = takeWhile isVariableChar s let name = takeWhile isVariableChar s
guard . not $ null name guard . not $ null name