Skip to content

Clarify single-line comment behavior in documentation#24

Open
chirsz-ever wants to merge 1 commit intoJSONC-org:mainfrom
chirsz-ever:patch-2
Open

Clarify single-line comment behavior in documentation#24
chirsz-ever wants to merge 1 commit intoJSONC-org:mainfrom
chirsz-ever:patch-2

Conversation

@chirsz-ever
Copy link
Copy Markdown
Contributor

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.

@DecimalTurn
Copy link
Copy Markdown
Member

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.

@DecimalTurn
Copy link
Copy Markdown
Member

I think a better option would be:

Single-line comments start with // and continue until a line ending, a line seperator (U+2028) or a paragraph seperator (U+2029) is encountered.

Thoughts?

@chirsz-ever
Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants