@@ -14,7 +14,6 @@ import SourceSyntax.PrettyPrint
1414import SourceSyntax.Declaration (Assoc)
1515import Text.Parsec hiding (newline,spaces,State)
1616import Text.Parsec.Indent
17−import Text.Read (readMaybe)
1817
1918reserveds = [ "if", "then", "else"
2019 , "case", "of"
@@ -50,6 +49,12 @@ iParseWithTable :: SourceName -> OpTable -> IParser a -> String -> Either ParseE
5049iParseWithTable sourceName table aParser input =
5150 runIndent sourceName $ runParserT aParser table sourceName input
5251
52+readMaybe :: Read a => String -> Maybe a
53+readMaybe s =
54+ case [ x | (x,t) <- reads s, ("","") <- lex t ] of
55+ [x] -> Just x
56+ _ -> Nothing
57+
5358backslashed :: IParser Char
5459backslashed = do
5560 char '\\'