Skip to content

Commit

Permalink
Fix unescaping in scala.
Browse files Browse the repository at this point in the history
  • Loading branch information
kanaka committed Sep 28, 2017
1 parent a7d9ace commit 150008c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scala/reader.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ object reader {
}

def parse_str(s: String): String = {
s.replace("\\\"", "\"").replace("\\n", "\n").replace("\\\\", "\\")
// TODO: use re.replaceAllIn instead for single pass
s.replace("\\\\", "\u029e")
.replace("\\\"", "\"")
.replace("\\n", "\n")
.replace("\u029e", "\\")
}

def read_atom(rdr: Reader): Any = {
Expand Down

0 comments on commit 150008c

Please sign in to comment.