X-Git-Url: https://git.rmz.io/my-scheme.git/blobdiff_plain/2c9201bc9abac31f46a43c621c4f47553d17c7a4..3144d06ee882e88a81a02c532061a48997506cf6:/app/Main.hs diff --git a/app/Main.hs b/app/Main.hs index 233fa6c..0c0d29c 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -18,11 +18,14 @@ spaces :: Parser () spaces = skipMany space parseString :: Parser LispVal -parseString = do - char '"' - x <- many (noneOf "\"") - char '"' - return $ String x +parseString = do char '"' + x <- many innerChar + char '"' + return $ String x + where innerChar = noneOf ['\\', '\"'] <|> escapeChar + escapeChar = do char '\\' + c <- oneOf "\"" + return $ '\"' parseAtom :: Parser LispVal parseAtom = do