2 ms·
> So far as I can tell, this doesn’t use [ or ] in its syntax at all Yes, that's why the GP chose those characters to delimit their example strings. I'll try
by reificator 6y ago
> So far as I can tell, this doesn’t use [ or ] in its syntax at all
Yes, that's why the GP chose those characters to delimit their example strings. I'll try again using ` characters to delimit the example strings.
> so all the values you give would be represented exactly as strings without any problem.
But what would those string representations hold? If I parse the below strings in a javascript context, what would I get?
` a`, `a `, `"a"` and `""`
Do I get this?
" a", "a ", "\"a\"" and "\"\""
Or do I get this?
"a", "a", "a" and ""
Or do I get something inbetween?
- simonh 6y agoOK, I got it. I still don't see the problem. The examples include strings starting with whitespace (One of the multi-line strings), so that's not a problem. Single line strings start with the first character after the colon and a space. If that happens to be a space character, so be it. Strings are terminated by a newline, so trailing spaces aren't a problem. Quote characters are just characters with no special meaning in this format, so those aren't a problem either. Unless the library implementing this format has a bug, there shouldn't be any issues.