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)
{
s1 = strpart(s, 2:-1) // remove surrounding quotes
s2 = streplaceall(s1, "\\n", "\n")
s3 = streplaceall(s2, "\\\"", "\"")
return streplaceall(s3, "\\\\", "\\")
s = strpart(s, 2:-1) // remove surrounding quotes
s = streplaceall(s, "\\\\", "\x01")
s = streplaceall(s, "\\n", "\n")
s = streplaceall(s, "\\\"", "\"")
return streplaceall(s, "\x01", "\\")
}
func read_atom(rdr)