changed indent method according to ghc standard

This commit is contained in:
IGI-111
2015-04-05 15:45:51 +02:00
parent 24d0dcba96
commit 32309510a8
4 changed files with 43 additions and 39 deletions

View File

@@ -1,31 +1,31 @@
module CSVParser (
parseCSV
)where
parseCSV
)where
import Text.ParserCombinators.Parsec
csvFile :: GenParser Char st [[String]]
csvFile = do
result <- many line
eof
return result
result <- many line
eof
return result
line :: GenParser Char st [String]
line = do
result <- cells
_ <- eol
return result
result <- cells
_ <- eol
return result
cells :: GenParser Char st [String]
cells = do
first <- cellContent
next <- remainingCells
return (first : next)
first <- cellContent
next <- remainingCells
return (first : next)
remainingCells :: GenParser Char st [String]
remainingCells =
(char ',' >> cells) -- Found comma? More cells coming
<|> return [] -- No comma? Return [], no more cells
(char ',' >> cells) -- Found comma? More cells coming
<|> return [] -- No comma? Return [], no more cells
cellContent :: GenParser Char st String
cellContent = many (noneOf ",\n")