1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-21 02:27:10 +03:00

yorick: Fix unescaping of "\\n"

This commit is contained in:
Dov Murik 2017-09-25 19:53:49 +00:00
parent c81a869e46
commit 33f404afd4

View File

@ -48,10 +48,11 @@ NUMBER_REGEXP = regcomp("^-?[0-9]+$")
func unescape(s) func unescape(s)
{ {
s1 = strpart(s, 2:-1) // remove surrounding quotes s = strpart(s, 2:-1) // remove surrounding quotes
s2 = streplaceall(s1, "\\n", "\n") s = streplaceall(s, "\\\\", "\x01")
s3 = streplaceall(s2, "\\\"", "\"") s = streplaceall(s, "\\n", "\n")
return streplaceall(s3, "\\\\", "\\") s = streplaceall(s, "\\\"", "\"")
return streplaceall(s, "\x01", "\\")
} }
func read_atom(rdr) func read_atom(rdr)