Use pattern matching instead of head
This commit is contained in:
parent
76b798394f
commit
115ef29079
|
@ -1298,7 +1298,7 @@ checkArithmeticDeref params t@(TA_Expansion _ [b@(T_DollarBraced id _ _)]) =
|
||||||
unless (isException $ bracedString b) getWarning
|
unless (isException $ bracedString b) getWarning
|
||||||
where
|
where
|
||||||
isException [] = True
|
isException [] = True
|
||||||
isException s = any (`elem` "/.:#%?*@$-!+=^,") s || isDigit (head s)
|
isException s@(h:_) = any (`elem` "/.:#%?*@$-!+=^,") s || isDigit h
|
||||||
getWarning = fromMaybe noWarning . msum . map warningFor $ parents params t
|
getWarning = fromMaybe noWarning . msum . map warningFor $ parents params t
|
||||||
warningFor t =
|
warningFor t =
|
||||||
case t of
|
case t of
|
||||||
|
|
Loading…
Reference in New Issue