Skip to content

Commit 7ad39cb

Browse files
AlisdairMtkoeppe
authored andcommitted
[lex.comment] Move the subclause earlier, to where it better fits
Comments should fit betweem character sets (to define the basic source character set) and preprocessor tokens, that must already understand comments in order to treat them as whitespace.
1 parent 8698ea4 commit 7ad39cb

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

source/lex.tex

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,29 @@
467467
None of these names or aliases have leading or trailing spaces.
468468
\end{note}
469469

470+
\rSec1[lex.comment]{Comments}
471+
472+
\pnum
473+
\indextext{comment|(}%
474+
\indextext{comment!\tcode{/*} \tcode{*/}}%
475+
\indextext{comment!\tcode{//}}%
476+
The characters \tcode{/*} start a comment, which terminates with the
477+
characters \tcode{*/}. These comments do not nest.
478+
\indextext{comment!\tcode{//}}%
479+
The characters \tcode{//} start a comment, which terminates immediately before the
480+
next new-line character. If there is a form-feed or a vertical-tab
481+
character in such a comment, only whitespace characters shall appear
482+
between it and the new-line that terminates the comment; no diagnostic
483+
is required.
484+
\begin{note}
485+
The comment characters \tcode{//}, \tcode{/*},
486+
and \tcode{*/} have no special meaning within a \tcode{//} comment and
487+
are treated just like other characters. Similarly, the comment
488+
characters \tcode{//} and \tcode{/*} have no special meaning within a
489+
\tcode{/*} comment.
490+
\end{note}
491+
\indextext{comment|)}
492+
470493
\rSec1[lex.pptoken]{Preprocessing tokens}
471494

472495
\indextext{token!preprocessing|(}%
@@ -681,29 +704,6 @@
681704
\end{note}
682705
\indextext{token|)}
683706

684-
\rSec1[lex.comment]{Comments}
685-
686-
\pnum
687-
\indextext{comment|(}%
688-
\indextext{comment!\tcode{/*} \tcode{*/}}%
689-
\indextext{comment!\tcode{//}}%
690-
The characters \tcode{/*} start a comment, which terminates with the
691-
characters \tcode{*/}. These comments do not nest.
692-
\indextext{comment!\tcode{//}}%
693-
The characters \tcode{//} start a comment, which terminates immediately before the
694-
next new-line character. If there is a form-feed or a vertical-tab
695-
character in such a comment, only whitespace characters shall appear
696-
between it and the new-line that terminates the comment; no diagnostic
697-
is required.
698-
\begin{note}
699-
The comment characters \tcode{//}, \tcode{/*},
700-
and \tcode{*/} have no special meaning within a \tcode{//} comment and
701-
are treated just like other characters. Similarly, the comment
702-
characters \tcode{//} and \tcode{/*} have no special meaning within a
703-
\tcode{/*} comment.
704-
\end{note}
705-
\indextext{comment|)}
706-
707707
\rSec1[lex.header]{Header names}
708708

709709
\indextext{header!name|(}%

0 commit comments

Comments
 (0)