Re: std.conv.parse too finicky?

2013-01-05 Thread Chris
On Saturday, 5 January 2013 at 13:10:29 UTC, FG wrote: On 2013-01-02 19:23, Chris wrote: Yes, I just thought it might be handy for reading user defined files like localization files etc, like this one (without quote). [ Close:Cerrar, Open:Abrir, ... ] But then you would probably also want sup

Re: std.conv.parse too finicky?

2013-01-05 Thread FG
On 2013-01-02 19:23, Chris wrote: Yes, I just thought it might be handy for reading user defined files like localization files etc, like this one (without quote). [ Close:Cerrar, Open:Abrir, ... ] But then you would probably also want support for comments. ;)

Re: std.conv.parse too finicky?

2013-01-02 Thread Chris
On Wednesday, 2 January 2013 at 17:22:57 UTC, monarch_dodra wrote: On Wednesday, 2 January 2013 at 17:02:48 UTC, Chris wrote: You could reduce burden by using raw strings: auto asso = `["key1":"value1", "key2":"value2"]`; Yes, I just thought it might be handy for reading user defined files li

Re: std.conv.parse too finicky?

2013-01-02 Thread Chris
On Wednesday, 2 January 2013 at 17:06:50 UTC, bearophile wrote: Chris: Couldn't the parser infer from string[string] that the key:value pairs should be treated as strings, regardless of whether they are quoted or not? That parser is meant to be used to de-serialize simple D data structures

Re: std.conv.parse too finicky?

2013-01-02 Thread monarch_dodra
On Wednesday, 2 January 2013 at 17:02:48 UTC, Chris wrote: I was playing around with std.conv.parse's mechanism for parsing associative arrays from strings (cf. http://dlang.org/phobos/std_conv.html#parse). A handy feature as it would allow user-friendly input formats that can be transformed i

Re: std.conv.parse too finicky?

2013-01-02 Thread bearophile
Chris: Couldn't the parser infer from string[string] that the key:value pairs should be treated as strings, regardless of whether they are quoted or not? That parser is meant to be used to de-serialize simple D data structures printed (serialized) with writeln. Bye, bearophile

std.conv.parse too finicky?

2013-01-02 Thread Chris
I was playing around with std.conv.parse's mechanism for parsing associative arrays from strings (cf. http://dlang.org/phobos/std_conv.html#parse). A handy feature as it would allow user-friendly input formats that can be transformed into a D-array. However, the parser is very finicky and expe