wc-duck / datalibrary

Open Source Data Library for data serialization.
Other
42 stars 8 forks source link

Failing to correctly surround a variable name in quotation marks gives bad error #67

Closed lundmark closed 6 years ago

lundmark commented 6 years ago

So if I have a named variable in a struct in a json file: "my_struct" : { "my_variable : 7, }

In case you missed it, there's no second quotation mark on the "my_variable". This gives an error : The type my_struct has no member named my_variable : 7,

An error that explains the missing quotation mark would be a lot better!

wc-duck commented 6 years ago

Sounds like the string-scanning need some love :)

wc-duck commented 6 years ago

Might not be perfect yet... but now it should say:

found a non-valid key "val : " in data, did you miss a string-terminator? (" or ') at line 0, col 26: { "single_int" : {"val : "1"} } ^

I think I'll find more on this when working on un-quoted keys for json5-support.