diff options
| author | Joel Martin <github@martintribe.org> | 2014-10-06 20:36:23 -0500 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2014-10-06 20:36:23 -0500 |
| commit | af8fdff41e260b1b21be0e127afb536980f43804 (patch) | |
| tree | 6dc9b5d54a38c6197001291cf85cdffc7cf100b7 /go/src/reader | |
| parent | 9feb2c9527294d82592bf35b97f8039f61bbec45 (diff) | |
| download | mal-af8fdff41e260b1b21be0e127afb536980f43804.tar.gz mal-af8fdff41e260b1b21be0e127afb536980f43804.zip | |
go: add step4_if_fn_do
Diffstat (limited to 'go/src/reader')
| -rw-r--r-- | go/src/reader/reader.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/go/src/reader/reader.go b/go/src/reader/reader.go index 55cea59..d4b7510 100644 --- a/go/src/reader/reader.go +++ b/go/src/reader/reader.go @@ -4,6 +4,7 @@ import ( "errors" "regexp" "strconv" + "strings" //"fmt" ) @@ -56,8 +57,10 @@ func read_atom(rdr Reader) (types.MalType, error) { } return i, nil } else if (*token)[0] == '"' { - // TODO: unquote newline and quotes - return (*token)[1:len(*token)-1], nil + str := (*token)[1:len(*token)-1] + return strings.Replace( + strings.Replace(str, `\"`, `"`, -1), + `\n`, "\n", -1), nil } else if *token == "nil" { return nil, nil } else if *token == "true" { |
