Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Hie/Cabal/Parser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ parseList i = many (nl <|> sl)
skipToNextLine :: Parser ()
skipToNextLine = skipWhile (not . isEndOfLine) >> endOfLine

-- This function may consume no inputs; so 'many skipToNextLineOrEOI' may go into infinite loop.
skipToNextLineOrEOI :: Parser ()
skipToNextLineOrEOI = skipWhile (not . isEndOfLine) >> (endOfInput <|> endOfLine)

comment :: Parser ()
comment = skipMany tabOrSpace >> "--" >> skipToNextLine

Expand All @@ -133,7 +137,7 @@ field i f p =
_ <- char ':'
skipMany tabOrSpace
p' <- p $ i' + 1
skipToNextLine
skipToNextLineOrEOI
pure p'

-- | Skip at least n spaces
Expand Down