In the grammar for
single-line-comment, do not require comments to be non-empty:
// single-line-comment-elem=>
//
In the grammar for
single-line-comment-elem, fix the category mismatch:
except
line-break=>
except a character that begins (and is the whole or a part of) a
line-breakor "except a character that matches
line-break-character"
In the grammar for
multi-line-comment:
Apply "opt" to
multi-line-comment-elem-seq.
In [lex.whitespaces]:
A disambiguation rule is required to prefer matching CRLF as a
line-break instead of two
line-breaks.
In the grammars for
h-char and
q-char, use whatever formulation was chosen for
single-line-comment-elem.
Same comment for the grammars of
basic-c-char and
basic-s-char.
Same comment for the grammar of
d-char. Additionally, use "a character that matches
horizontal-whitespace-character" instead of the implied "a character that is
horizontal-whitespace-character".
The [lex.string], the "
line-break" in a raw string literal wording could be more explicit about scanning for line-breaks (sequences matching a
line-break is not a
line-break "for free"; it is a
line-break if, for example, the grammar asks for a
line-break).
This can be done by adding
line-break under the
r-char grammar and adjusting the other
r-char case with the formula from
single-line-comment-elem.
In [cpp.line]:
number of
line-break=>
number of
line-breaks
In [lex.pptoken]:
The instances of "non-whitespace character" with respect to the "cannot be one of the above" case is problematic if the interpretation leaves us with cases where there are Unicode whitespace characters that are a part of neither a preprocessing token nor a whitespace. That's a new situation, which the surrounding wording could not be relied upon to handle in a straightforward manner.
This could be fixed by replacing:
each non-whitespace character that cannot be one of the above
=>
each character that cannot be considered part of a
whitespace and cannot be one of the above
This also happens to fix a pre-existing issue that the wording is rather weak on preferring to interpret comments as comments.