@@ -54,10 +54,12 @@ lexWS = do i <- getInput
5454
5555 simpleSpace = skipMany1 (satisfy isSpace)
5656 oneLineComment = do try (do string ("--")
57+ skipMany simpleSpace
5758 satisfy (\x -> x /= '|' && x /= '^'))
5859 skipMany (satisfy (/= '\n'))
5960 return ()
6061 multiLineComment = do try (do string "{-"
62+ skipMany simpleSpace
6163 satisfy (\x -> x /= '|' && x /= '^'))
6264 inCommentMulti
6365
@@ -132,13 +134,19 @@ mkName (n, ns) = NS (UN n) (reverse (parseNS ns))
132134
133135pDocComment :: Char -> CParser a String
134136pDocComment c
135− = try (do string ("--" ++ [c])
137+ = try (do string ("--")
138+ skipMany simpleSpace
139+ char c
140+ skipMany simpleSpace
136141 i <- getInput
137142 let (doc, rest) = span (/='\n') i
138143 setInput rest
139144 whiteSpace
140145 return doc)
141− <|> try (do string ("{-" ++ [c])
146+ <|> try (do string ("{-")
147+ skipMany simpleSpace
148+ char c
149+ skipMany simpleSpace
142150 i <- getInput
143151 -- read to '-}'
144152 let (doc, rest) = spanComment "" i
@@ -148,6 +156,7 @@ pDocComment c
148156 where spanComment acc ('-':'}':xs) = (reverse acc, xs)
149157 spanComment acc (x:xs) = spanComment (x : acc) xs
150158 spanComment acc [] = (acc, [])
159+ simpleSpace = skipMany1 (satisfy isSpace)
151160
152161pDef :: CParser a (Name, RDef)
153162pDef = try (do x <- iName []; lchar ':'; ty <- pTerm