]> git.rmz.io Git - my-scheme.git/blobdiff - app/Main.hs
Support escaped quotes
[my-scheme.git] / app / Main.hs
index cea4c9b2f5e9f08230d49f837338d1e9cce484a7..0c0d29c7a4acf3351624522b2e96080c4b4c1fc5 100644 (file)
@@ -22,7 +22,10 @@ parseString = do char '"'
                  x <- many innerChar
                  char '"'
                  return $ String x
-              where innerChar = noneOf "\""
+              where innerChar = noneOf ['\\', '\"'] <|> escapeChar
+                    escapeChar = do char '\\'
+                                    c <- oneOf "\""
+                                    return $ '\"'
 
 parseAtom :: Parser LispVal
 parseAtom = do