cosmetic change.

This commit is contained in:
Kazu Yamamoto 2010-04-27 10:28:00 +09:00
parent 27f42b6c90
commit 40bdc70f8b

View File

@ -61,14 +61,14 @@ anyName = many1 . oneOf $ ['A'..'Z'] ++ ['a'..'z'] ++ ['0'..'9'] ++ "_'#"
manyBefore :: Show tok => GenParser tok st a -> GenParser tok st [tok] -> GenParser tok st [a]
manyBefore p anchor = manyTill p (eof <|> try anc)
where
anc = do
pos <- getPosition
s <- anchor
ss <- getInput
setInput $ s ++ ss
setPosition pos
return ()
where
anc = do
pos <- getPosition
s <- anchor
ss <- getInput
setInput $ s ++ ss
setPosition pos
return ()
keyword :: Parser String
keyword = (++) <$> modName <*> string "."
@ -78,8 +78,8 @@ ghcName = do
keyword
try sep <|> end
where
sep = last <$> sepBy1 anyName (char '.')
end = "" <$ endBy1 anyName (char '.')
sep = last <$> sepBy1 anyName (char '.')
end = "" <$ endBy1 anyName (char '.')
nonGhcName :: Parser String
nonGhcName = (:) <$> anyChar <*> manyBefore anyChar keyword