The format could be very simple, but... allowing comments after values make it unnecessarily complex to parse. For example: value = "example # no that's not a comment" # but here's one If inline comments where not allowed we could just check the first and last character for a quote and we know we have a string, same for arrays (check for [ and ]). But with inline comments, we need to parse the whole string. As far as…
WAT?. Python can parse the above very nicely, thank you. >>> value = "example # no that's not a comment" # but here's one >>> value "example # no that's not a comment"
At the time I wrote that, the only Python parser was removing the comments by splitting the line on "#", which mean it wouldn't work with the example I mentioned.
It seems there are now several other Python parsers, so some of them are probably getting it right.