@@ -212,7 +212,7 @@ notFollowedBy' p = try $ join $ do a <- try p
212212-- (This version due to Andrew Pimlott on the Haskell mailing list.)
213213
214214oneOfStrings' :: (Char -> Char -> Bool) -> [String] -> Parser [Char] st String
215−oneOfStrings' matches [] = fail "no strings"
215+oneOfStrings' _ [] = fail "no strings"
216216oneOfStrings' matches strs = try $ do
217217 c <- anyChar
218218 let strs' = [xs | (x:xs) <- strs, x `matches` c]
@@ -392,10 +392,13 @@ schemes = ["coap","doi","javascript","aaa","aaas","about","acap","cap","cid",
392392 "ventrilo","view-source","webcal","wtai","wyciwyg","xfire","xri",
393393 "ymsgr"]
394394
395+uriScheme :: Parser [Char] st String
396+uriScheme = oneOfStringsCI schemes
397+
395398-- | Parses a URI. Returns pair of original and URI-escaped version.
396399uri :: Parser [Char] st (String, String)
397400uri = try $ do
398− scheme <- oneOfStringsCI schemes
401+ scheme <- uriScheme
399402 char ':'
400403 -- /^[\/\w\u0080-\uffff]+|%[A-Fa-f0-9]+|&#?\w+;|(?:[,]+|[\S])[%&~\w\u0080-\uffff]/
401404 -- We allow punctuation except at the end, since