Skip to content

Commit

Permalink
fix JuliaIO#21 : carriage return in string
Browse files Browse the repository at this point in the history
  • Loading branch information
aviks committed Jul 12, 2013
1 parent c7ebaa3 commit 23b7f15
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ module Parser
return s
end
c = str[s]
while (c == ' ' || c == '\t' || c == '\n') && s < e
while (c == ' ' || c == '\t' || c == '\n' || c=='\r') && s < e
s += 1
c = str[s]
end
Expand Down
4 changes: 4 additions & 0 deletions test/JSON.jl
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,7 @@ fetch(finished_async_tests)
obj = JSON.parse("{\"a\":2e10}")
@assert(obj["a"] == 2e10)

#test for issue 21
a=JSON.parse(test21)
@assert isa(a, Array{Any})
@assert length(a) == 2
2 changes: 1 addition & 1 deletion test/json_samples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -610,4 +610,4 @@ unicode = "{\"অলিম্পিকস\": {




test21 = "[\r\n{\r\n\"a\": 1,\r\n\"b\": 2\r\n},\r\n{\r\n\"a\": 3,\r\n\"b\": 4\r\n}\r\n]"

0 comments on commit 23b7f15

Please sign in to comment.