Clarify single-line comment behavior in documentation - #24
Conversation
|
I think the current wording is already clear enough. The comment still continues until a line ending is reached, it's just that when comment is at the end of the file with no EOL at the end, we stop at EOF while we are still inside the comment. |
|
I think a better option would be:
Thoughts? |
|
I'm glad we're on the same page. The PR has been revised to match your wording. With the ABNF description, the importance of natural language description is reduced; it's OK to edit or close this PR. |
|
Based on the updated discussions in #23 (comment), I'll close this PR for now since we are not likely to allow U+2028 and U+2029 for security reasons. Regarding the comment added at the end of the code snippet to illustrate that a comment at the end of the file is still valid even if it doesn't have a line ending after it, I don't thing this is something that the average JSONC user is worried about and it goes without saying I'd say. However, it's something that has to be clear in the ABNF: Having the option to skip the
|

According to ECMA-262, a single-line comment consists of
//followed by characters which are not line terminators.Therefore, a line comment can be placed at the end of a file, string, or input without being followed by a newline character.