@@ -54,10 +54,12 @@ lexWS = do i <- getInput
55 simpleSpace = skipMany1 (satisfy isSpace)
55 simpleSpace = skipMany1 (satisfy isSpace)
56 oneLineComment = do try (do string ("--")
56 oneLineComment = do try (do string ("--")
57 satisfy (\x -> x /= '|' && x /= '^'))
58 satisfy (\x -> x /= '|' && x /= '^'))
58 skipMany (satisfy (/= '\n'))
59 skipMany (satisfy (/= '\n'))
60 multiLineComment = do try (do string "{-"
61 multiLineComment = do try (do string "{-"
61 satisfy (\x -> x /= '|' && x /= '^'))
63 satisfy (\x -> x /= '|' && x /= '^'))
62 inCommentMulti
64 inCommentMulti
@@ -132,13 +134,19 @@ mkName (n, ns) = NS (UN n) (reverse (parseNS ns))
133pDocComment :: Char -> CParser a String
135pDocComment :: Char -> CParser a String
134pDocComment c
136pDocComment c
135− = try (do string ("--" ++ [c])
137+ = try (do string ("--")
138+ skipMany simpleSpace
140+ skipMany simpleSpace
136 i <- getInput
141 i <- getInput
137 let (doc, rest) = span (/='\n') i
142 let (doc, rest) = span (/='\n') i
138 setInput rest
143 setInput rest
139 whiteSpace
144 whiteSpace
140 return doc)
145 return doc)
141− <|> try (do string ("{-" ++ [c])
146+ <|> try (do string ("{-")
147+ skipMany simpleSpace
149+ skipMany simpleSpace
142 i <- getInput
150 i <- getInput
143 -- read to '-}'
151 -- read to '-}'
144 let (doc, rest) = spanComment "" i
152 let (doc, rest) = spanComment "" i
@@ -148,6 +156,7 @@ pDocComment c
148 where spanComment acc ('-':'}':xs) = (reverse acc, xs)
156 where spanComment acc ('-':'}':xs) = (reverse acc, xs)
149 spanComment acc (x:xs) = spanComment (x : acc) xs
157 spanComment acc (x:xs) = spanComment (x : acc) xs
150 spanComment acc [] = (acc, [])
158 spanComment acc [] = (acc, [])
159+ simpleSpace = skipMany1 (satisfy isSpace)
152pDef :: CParser a (Name, RDef)
161pDef :: CParser a (Name, RDef)
153pDef = try (do x <- iName []; lchar ':'; ty <- pTerm
162pDef = try (do x <- iName []; lchar ':'; ty <- pTerm