RFC: std.json sucessor

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 22 08:47:50 PDT 2014


On 2014-08-22 00:35, Sönke Ludwig wrote:
> Following up on the recent "std.jgrandson" thread [1], I've picked up
> the work (a lot earlier than anticipated) and finished a first version
> of a loose blend of said std.jgrandson, vibe.data.json and some changes
> that I had planned for vibe.data.json for a while. I'm quite pleased by
> the results so far, although without a serialization framework it still
> misses a very important building block.
>
> Code: https://github.com/s-ludwig/std_data_json
> Docs: http://s-ludwig.github.io/std_data_json/
> DUB: http://code.dlang.org/packages/std_data_json

* Opening braces should be put on their own line to follow Phobos style 
guides

* I'm wondering about the assert in lexer.d, line 160. What happens if 
two invalid tokens after each other occur?

* I think we have talked about this before, when reviewing D lexers. I'm 
thinking of how to handle invalid data. Is it the best solution to throw 
an exception? Would it be possible to return an error token and have the 
client decide what to do about? Shouldn't it be possible to build a JSON 
validator on this?

* The lexer seems to always convert JSON types to their native D types, 
is that wise to do? That's unnecessary if you're implementing syntax 
highlighting

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list