Open
Description
When parsing JSON values from an input stream like this
using JSON
while !eof(stdin)
JSON.parse(stdin)
end
depending on the type of a value in the input, parsing either succeeds or fails.
For example, if the code above is in parse.jl
, and file 1.in
contains just 5
(no spaces before or after the number), this works:
$ julia parse.jl < 1.in
But if 2.in
contains [5]
instead (no spaces before or after the list), then there is an error:
$ julia parse.jl < 2.in
ERROR: LoadError: Unexpected end of input
...when parsing byte with value '10'