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:
parent
c81a869e46
commit
33f404afd4
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user