on master help sign in
make hlint adjustments
commit011e28f475204baa3b4925e631863572578c3ac9 authorAgentM <agentm@themactionfaction.com> dateFri 22 Sep 2017, 18:55 (9 years ago) parent1805b77
1 file changed+4−6
src/lib/ProjectM36/Relation/Parse/CSV.hs+4−6
src/lib/ProjectM36/Relation/Parse/CSV.hs+4−6
@@ -146,14 +146,12 @@ quotedString = do
146146 APT.skip (== '"')
147147 (_, s) <- APT.runScanner [] (\prevl nextChar -> case prevl of
148148 [] -> Just [nextChar]
149− chars -> if last chars == '\\' then
149+ chars | last chars == '\\' ->
150150 case lookup nextChar escapeMap of
151151 Nothing -> Just (chars ++ [nextChar]) --there is no escape sequence, so leave backslash + char
152− Just escapeVal -> Just ((init chars) ++ [escapeVal]) -- nuke the backslash and add the escapeVal
153− else if nextChar == '"' then
154− Nothing
155− else
156− Just (chars ++ [nextChar]))
152+ Just escapeVal -> Just (init chars ++ [escapeVal]) -- nuke the backslash and add the escapeVal
153+ | nextChar == '"' -> Nothing
154+ | otherwise -> Just (chars ++ [nextChar]))
157155 APT.skip (== '"')
158156 pure (T.pack s)
159157