Lazily parse a JSON text file using stdx.data.json?

WebFreak001 d.forum at webfreak.org
Sun Dec 17 10:28:04 UTC 2017


On Sunday, 17 December 2017 at 04:34:22 UTC, David Gileadi wrote:
> I'm a longtime fan of dlang, but haven't had a chance to do 
> much in-depth dlang programming, and especially not range 
> programming. Today I thought I'd use stdx.data.json to read 
> from a text file. Since it's a somewhat large file, I thought 
> I'd create a text range from the file and parse it that way. 
> stdx.data.json has a great interface for lazily parsing text 
> into JSON values, so all I had to do was turn a text file into 
> a lazy range of UTF-8 chars that stdx.data.json's lexer could 
> use. (In my best Clarkson voice:) How hard could it be?
>
> [...]

uh I don't know about stdx.data.json but if you didn't manage to 
succeed yet, I know that asdf[1] works really well with streaming 
json. There is also an example how it works.

[1]: http://asdf.dub.pm


More information about the Digitalmars-d mailing list