- | isHexEscape [h1,h0] = cont (TKchar (hexToChar h1 h0)) cs
-lexChar cont ('\\':cs) = failP "invalid char character" ('\\':(take 10 cs))
-lexChar cont ('\'':cs) = failP "invalid char character" ['\'']
-lexChar cont ('\"':cs) = failP "invalid char character" ['\"']
-lexChar cont (c:'\'':cs) = cont (TKchar c) cs
-
-
+ | isHexEscape [h1,h0] = cont (TKchar (hexToChar h1 h0)) cs
+lexChar _ ('\\':cs) = failP "invalid char character" ('\\':(take 10 cs))
+lexChar _ ('\'':_) = failP "invalid char character" ['\'']
+lexChar _ ('\"':_) = failP "invalid char character" ['\"']
+lexChar cont (c:'\'':cs) = cont (TKchar c) cs
+lexChar _ cs = panic ("lexChar: " ++ show cs)
+
+lexString :: String -> (Token -> [Char] -> Int -> ParseResult a)
+ -> String -> Int -> ParseResult a