mirror of
https://github.com/kanaka/mal.git
synced 2024-09-11 13:55:55 +03:00
io: Fix unneeded escaping of forward slash
Instead of using Io's `asJson` method which escapes forward slashes, implement our own string escaping code so it fits the Mal requirements. The relevant step1 test was modified from soft to hard.
This commit is contained in:
parent
92e1d438cd
commit
748df6f7bd
@ -7,7 +7,9 @@ Number malPrint := method(readable, self asString)
|
||||
|
||||
// Io strings are of type Sequence
|
||||
Sequence malPrint := method(readable,
|
||||
if(readable, self asString asJson, self asString)
|
||||
if(readable,
|
||||
"\"" .. (self asString asMutable replaceSeq("\\", "\\\\") replaceSeq("\"", "\\\"") replaceSeq("\n", "\\n")) .. "\"",
|
||||
self asString)
|
||||
)
|
||||
|
||||
MalMeta := Object clone do(
|
||||
|
@ -98,6 +98,8 @@ false
|
||||
;=>","
|
||||
"-"
|
||||
;=>"-"
|
||||
"/"
|
||||
;=>"/"
|
||||
":"
|
||||
;=>":"
|
||||
";"
|
||||
@ -275,6 +277,3 @@ false
|
||||
;; fantom fails this one
|
||||
"!"
|
||||
;=>"!"
|
||||
;; io fails this one
|
||||
"/"
|
||||
;=>"/"
|
||||
|
Loading…
Reference in New Issue
Block a user