D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10776 - std.json parseJSON has a bug.
Summary: std.json parseJSON has a bug.
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Linux
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-08 06:03 UTC by khurshid
Modified: 2014-04-24 20:06 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description khurshid 2013-08-08 06:03:13 UTC
I think that, this code must be throw, but it's success run.

import std.json;
import std.stdio : writeln;

void main()
{
 ////////////////////////// leading spaces doesn't skip between 1 and E.
   auto json = parseJSON(`{ "throwable_one" : 1             .E    +1 }`);
                  

   writeln( toJSON(&json) );
}
Comment 1 hsteoh 2013-08-17 09:47:56 UTC
This violates RFC 4627 (http://www.ietf.org/rfc/rfc4627.txt), so it's definitely a bug in std.json.
Comment 2 Andrej Mitrovic 2014-04-24 20:06:15 UTC
This now throws an exception.