fix issue 2450 ipv6 warning

This commit is contained in:
Weigang Geng 2022-02-15 23:56:34 -08:00
commit a455b9e805

View file

@ -2703,7 +2703,7 @@ checkCharRangeGlob p t@(T_Glob id str) |
&& contents /= ":"
then warn id 2101 "Named class needs outer [], e.g. [[:digit:]]."
else
when ('[' `notElem` contents && hasDupes) $
when ('[' `notElem` contents && ':' `notElem` contents && hasDupes) $
info id 2102 "Ranges can only match single chars (mentioned due to duplicates)."
where
isCharClass str = "[" `isPrefixOf` str && "]" `isSuffixOf` str