mirror of
https://github.com/kanaka/mal.git
synced 2024-09-21 10:37:58 +03:00
yorick: Fix unescaping of "\\n"
This commit is contained in:
parent
c81a869e46
commit
33f404afd4
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user