cosmetic change.
This commit is contained in:
parent
27f42b6c90
commit
40bdc70f8b
20
Browse.hs
20
Browse.hs
@ -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 :: Show tok => GenParser tok st a -> GenParser tok st [tok] -> GenParser tok st [a]
|
||||||
manyBefore p anchor = manyTill p (eof <|> try anc)
|
manyBefore p anchor = manyTill p (eof <|> try anc)
|
||||||
where
|
where
|
||||||
anc = do
|
anc = do
|
||||||
pos <- getPosition
|
pos <- getPosition
|
||||||
s <- anchor
|
s <- anchor
|
||||||
ss <- getInput
|
ss <- getInput
|
||||||
setInput $ s ++ ss
|
setInput $ s ++ ss
|
||||||
setPosition pos
|
setPosition pos
|
||||||
return ()
|
return ()
|
||||||
|
|
||||||
keyword :: Parser String
|
keyword :: Parser String
|
||||||
keyword = (++) <$> modName <*> string "."
|
keyword = (++) <$> modName <*> string "."
|
||||||
@ -78,8 +78,8 @@ ghcName = do
|
|||||||
keyword
|
keyword
|
||||||
try sep <|> end
|
try sep <|> end
|
||||||
where
|
where
|
||||||
sep = last <$> sepBy1 anyName (char '.')
|
sep = last <$> sepBy1 anyName (char '.')
|
||||||
end = "" <$ endBy1 anyName (char '.')
|
end = "" <$ endBy1 anyName (char '.')
|
||||||
|
|
||||||
nonGhcName :: Parser String
|
nonGhcName :: Parser String
|
||||||
nonGhcName = (:) <$> anyChar <*> manyBefore anyChar keyword
|
nonGhcName = (:) <$> anyChar <*> manyBefore anyChar keyword
|
||||||
|
Loading…
Reference in New Issue
Block a user