diff --git a/cs/reader.cs b/cs/reader.cs index a644309a8a..60798e37bf 100644 --- a/cs/reader.cs +++ b/cs/reader.cs @@ -71,9 +71,10 @@ public static MalVal read_atom(Reader rdr) { } else if (match.Groups[6].Value != String.Empty) { string str = match.Groups[6].Value; str = str.Substring(1, str.Length-2) - .Replace("\\\"", "\"") - .Replace("\\n", "\n") - .Replace("\\\\", "\\"); + .Replace("\\\\", "\u029e") + .Replace("\\\"", "\"") + .Replace("\\n", "\n") + .Replace("\u029e", "\\"); return new Mal.types.MalString(str); } else if (match.Groups[7].Value != String.Empty) { return new Mal.types.MalString("\u029e" + match.Groups[7].Value); diff --git a/hy/reader.hy b/hy/reader.hy index 41abec29d3..4c9bd1d525 100644 --- a/hy/reader.hy +++ b/hy/reader.hy @@ -25,9 +25,10 @@ (!= (get t 0) ";"))) (defn unescape [s] - (-> s (.replace "\\\"" "\"") - (.replace "\\n" "\n") - (.replace "\\\\" "\\"))) + (-> s (.replace "\\\\" "\u029e") + (.replace "\\\"" "\"") + (.replace "\\n" "\n") + (.replace "\u029e" "\\"))) (defn read-atom [rdr] (setv token (.next rdr)) diff --git a/nim/Dockerfile b/nim/Dockerfile index 9744753e93..1ffef105b5 100644 --- a/nim/Dockerfile +++ b/nim/Dockerfile @@ -26,10 +26,10 @@ RUN apt-get -y install g++ # Nim RUN apt-get -y install xz-utils -RUN cd /tmp && curl -O http://nim-lang.org/download/nim-0.17.0.tar.xz \ - && tar xvJf /tmp/nim-0.17.0.tar.xz && cd nim-0.17.0 \ +RUN cd /tmp && curl -O https://nim-lang.org/download/nim-0.17.2.tar.xz \ + && tar xvJf /tmp/nim-0.17.2.tar.xz && cd nim-0.17.2 \ && make && sh install.sh /usr/local/bin \ && cp bin/nim /usr/local/bin/ \ - && rm -r /tmp/nim-0.17.0 + && rm -r /tmp/nim-0.17.2 ENV HOME /mal diff --git a/nim/reader.nim b/nim/reader.nim index 4df8c9c5b6..6bc2997fee 100644 --- a/nim/reader.nim +++ b/nim/reader.nim @@ -61,7 +61,7 @@ proc read_hash_map(r: var Reader): MalType = proc read_atom(r: var Reader): MalType = let t = r.next if t.match(intRE): number t.parseInt - elif t[0] == '"': str t[1 .. '' then begin Str := copy(Token, 2, Length(Token)-2); - Str := StringReplace(Str, '\"', '"', [rfReplaceAll]); - Str := StringReplace(Str, '\n', #10, [rfReplaceAll]); - Str := StringReplace(Str, '\\', '\', [rfReplaceAll]); + Str := StringReplace(Str, '\\', #127, [rfReplaceAll]); + Str := StringReplace(Str, '\"', '"', [rfReplaceAll]); + Str := StringReplace(Str, '\n', #10, [rfReplaceAll]); + Str := StringReplace(Str, #127, '\', [rfReplaceAll]); read_atom := TMalString.Create(Str) end else if RE.Match[7] <> '' then diff --git a/ps/reader.ps b/ps/reader.ps index 3574242f0e..c5e19bf158 100644 Binary files a/ps/reader.ps and b/ps/reader.ps differ diff --git a/rpython/reader.py b/rpython/reader.py index 5f8af46b22..4f5e3b4d8e 100644 --- a/rpython/reader.py +++ b/rpython/reader.py @@ -51,9 +51,9 @@ def read_atom(reader): return MalStr(u"") else: s = unicode(token[1:end]) - s = types._replace(u'\\\\', u"\u029e", s) - s = types._replace(u'\\"', u'"', s) - s = types._replace(u'\\n', u"\n", s) + s = types._replace(u'\\\\', u"\u029e", s) + s = types._replace(u'\\"', u'"', s) + s = types._replace(u'\\n', u"\n", s) s = types._replace(u"\u029e", u"\\", s) return MalStr(s) elif token[0] == ':': return _keywordu(unicode(token[1:])) diff --git a/vb/reader.vb b/vb/reader.vb index cc42a14747..89b2c64e1b 100644 --- a/vb/reader.vb +++ b/vb/reader.vb @@ -83,9 +83,10 @@ Namespace Mal Dim str As String = match.Groups(6).Value return New Mal.types.MalString( str.Substring(1, str.Length-2) _ - .Replace("\""", """") _ - .Replace("\n", Environment.NewLine) _ - .Replace("\\", "\")) + .Replace("\\", ChrW(&H029e)) _ + .Replace("\""", """") _ + .Replace("\n", Environment.NewLine) _ + .Replace(ChrW(&H029e), "\")) Else If match.Groups(7).Value <> String.Empty Then return New Mal.types.MalString(ChrW(&H029e) & match.Groups(7).Value) Else If match.Groups(8).Value <> String.Empty Then