-
Notifications
You must be signed in to change notification settings - Fork 773
Use \term and \defnx more correctly and consistently #980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -870,26 +870,21 @@ | |
\pnum | ||
\indextext{literal!\idxcode{unsigned}}% | ||
\indextext{literal!\idxcode{long}}% | ||
\indextext{literal!integer}% | ||
\indextext{literal!binary}% | ||
\indextext{literal!octal}% | ||
\indextext{literal!decimal}% | ||
\indextext{literal!hexadecimal}% | ||
\indextext{literal!base~of integer}% | ||
An \term{integer literal} is a sequence of digits that has no period | ||
An \defnx{integer literal}{literal!integer} is a sequence of digits that has no period | ||
or exponent part, with optional separating single quotes that are ignored | ||
when determining its value. An integer literal may have a prefix that specifies | ||
its base and a suffix that specifies its type. The lexically first digit | ||
of the sequence of digits is the most significant. | ||
A \term{binary} integer literal (base two) begins with | ||
A \defnx{binary}{literal!binary} integer literal (base two) begins with | ||
\tcode{0b} or \tcode{0B} and consists of a sequence of binary digits. | ||
An \term{octal} integer | ||
An \defnx{octal}{literal!octal} integer | ||
literal (base eight) begins with the digit \tcode{0} and consists of a | ||
sequence of octal digits.\footnote{The digits \tcode{8} and \tcode{9} are not octal digits. } | ||
A \term{decimal} | ||
A \defnx{decimal}{literal!decimal} | ||
integer literal (base ten) begins with a digit other than \tcode{0} and | ||
consists of a sequence of decimal digits. | ||
A \term{hexadecimal} integer literal (base sixteen) begins with | ||
A \defnx{hexadecimal}{literal!hexadecimal} integer literal (base sixteen) begins with | ||
\tcode{0x} or \tcode{0X} and consists of a sequence of hexadecimal | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please put all of "XXX integer literal" into the first argument of \defnx; we're not actually defining the term "decimal" here, but the phrase "decimal integer literal". |
||
digits, which include the decimal digits and the letters \tcode{a} | ||
through \tcode{f} and \tcode{A} through \tcode{F} with decimal values | ||
|
@@ -1298,10 +1293,8 @@ | |
The integer and fraction parts both consist of | ||
a sequence of decimal (base ten) digits if there is no prefix, or | ||
hexadecimal (base sixteen) digits if the prefix is \tcode{0x} or \tcode{0X}. | ||
\indextext{literal!decimal floating}% | ||
The literal is a \term{decimal floating literal} in the former case and | ||
\indextext{literal!hexadecimal floating}% | ||
a \term{hexadecimal floating literal} in the latter case. | ||
The literal is a \defnx{decimal floating literal}{literal!decimal floating} in the former case and | ||
a \defnx{hexadecimal floating literal}{literal!hexadecimal floating} in the latter case. | ||
Optional separating single quotes in | ||
a \grammarterm{digit-sequence} or \grammarterm{hexadecimal-digit-sequence} | ||
are ignored when determining its value. | ||
|
@@ -1498,7 +1491,7 @@ | |
also referred to as narrow | ||
string literals. A narrow string literal has type | ||
\indextext{literal!string!type~of}% | ||
``array of \term{n} \tcode{const char}'', where \term{n} is the size of | ||
``array of \placeholder{n} \tcode{const char}'', where \placeholder{n} is the size of | ||
the string as defined below, and has static storage | ||
duration~(\ref{basic.stc}). | ||
|
||
|
@@ -1513,7 +1506,7 @@ | |
\indextext{prefix!\idxcode{u}}% | ||
such as \tcode{u"asdf"}, is | ||
a \tcode{char16_t} string literal. A \tcode{char16_t} string literal has | ||
type ``array of \term{n} \tcode{const char16_t}'', where \term{n} is the | ||
type ``array of \placeholder{n} \tcode{const char16_t}'', where \placeholder{n} is the | ||
size of the string as defined below; it | ||
is initialized with the given characters. A single \grammarterm{c-char} may | ||
produce more than one \tcode{char16_t} character in the form of | ||
|
@@ -1525,7 +1518,7 @@ | |
\indextext{prefix!\idxcode{U}}% | ||
such as \tcode{U"asdf"}, is | ||
a \tcode{char32_t} string literal. A \tcode{char32_t} string literal has | ||
type ``array of \term{n} \tcode{const char32_t}'', where \term{n} is the | ||
type ``array of \placeholder{n} \tcode{const char32_t}'', where \placeholder{n} is the | ||
size of the string as defined below; it | ||
is initialized with the given characters. | ||
|
||
|
@@ -1538,8 +1531,8 @@ | |
\indextext{\idxcode{wchar_t}}% | ||
\indextext{literal!string!wide}% | ||
\indextext{prefix!\idxcode{L}}% | ||
A wide string literal has type ``array of \term{n} \tcode{const | ||
wchar_t}'', where \term{n} is the size of the string as defined below; it | ||
A wide string literal has type ``array of \placeholder{n} \tcode{const | ||
wchar_t}'', where \placeholder{n} is the size of the string as defined below; it | ||
is initialized with the given characters. | ||
|
||
\pnum | ||
|
@@ -1726,93 +1719,93 @@ | |
\pnum | ||
A \grammarterm{user-defined-literal} is treated as a call to a literal operator or | ||
literal operator template~(\ref{over.literal}). To determine the form of this call for a | ||
given \grammarterm{user-defined-literal} \term{L} with \grammarterm{ud-suffix} \term{X}, | ||
the \grammarterm{literal-operator-id} whose literal suffix identifier is \term{X} is | ||
looked up in the context of \term{L} using the rules for unqualified name | ||
lookup~(\ref{basic.lookup.unqual}). Let \term{S} be the set of declarations found by | ||
this lookup. \term{S} shall not be empty. | ||
given \grammarterm{user-defined-literal} \placeholder{L} with \grammarterm{ud-suffix} \placeholder{X}, | ||
the \grammarterm{literal-operator-id} whose literal suffix identifier is \placeholder{X} is | ||
looked up in the context of \placeholder{L} using the rules for unqualified name | ||
lookup~(\ref{basic.lookup.unqual}). Let \placeholder{S} be the set of declarations found by | ||
this lookup. \placeholder{S} shall not be empty. | ||
|
||
\pnum | ||
If \term{L} is a \grammarterm{user-defined-integer-literal}, let \term{n} be the literal | ||
without its \grammarterm{ud-suffix}. If \term{S} contains a literal operator with | ||
parameter type \tcode{unsigned long long}, the literal \term{L} is treated as a call of | ||
If \placeholder{L} is a \grammarterm{user-defined-integer-literal}, let \placeholder{n} be the literal | ||
without its \grammarterm{ud-suffix}. If \placeholder{S} contains a literal operator with | ||
parameter type \tcode{unsigned long long}, the literal \placeholder{L} is treated as a call of | ||
the form | ||
|
||
\begin{codeblock} | ||
operator "" @\term{X}@(@\term{n}@ULL) | ||
operator "" @\placeholder{X}@(@\placeholder{n}@ULL) | ||
\end{codeblock} | ||
|
||
Otherwise, \term{S} shall contain a raw literal operator or a literal operator | ||
template~(\ref{over.literal}) but not both. If \term{S} contains a raw literal operator, | ||
the literal \term{L} is treated as a call of the form | ||
Otherwise, \placeholder{S} shall contain a raw literal operator or a literal operator | ||
template~(\ref{over.literal}) but not both. If \placeholder{S} contains a raw literal operator, | ||
the literal \placeholder{L} is treated as a call of the form | ||
|
||
\begin{codeblock} | ||
operator "" @\term{X}@(@"\term{n}{"}@) | ||
operator "" @\placeholder{X}@(@"\placeholder{n}{"}@) | ||
\end{codeblock} | ||
|
||
Otherwise (\term{S} contains a literal operator template), \term{L} is treated as a call | ||
Otherwise (\placeholder{S} contains a literal operator template), \placeholder{L} is treated as a call | ||
of the form | ||
|
||
|
||
\begin{codeblock} | ||
operator "" @\term{X}@<'@$c_1$@', '@$c_2$@', ... '@$c_k$@'>() | ||
operator "" @\placeholder{X}@<'@$c_1$@', '@$c_2$@', ... '@$c_k$@'>() | ||
\end{codeblock} | ||
|
||
where \term{n} is the source character sequence $c_1c_2...c_k$. \begin{note} The sequence | ||
where \placeholder{n} is the source character sequence $c_1c_2...c_k$. \begin{note} The sequence | ||
$c_1c_2...c_k$ can only contain characters from the basic source character set. | ||
\end{note} | ||
|
||
\pnum | ||
If \term{L} is a \grammarterm{user-defined-floating-literal}, let \term{f} be the | ||
literal without its \grammarterm{ud-suffix}. If \term{S} contains a literal operator | ||
with parameter type \tcode{long double}, the literal \term{L} is treated as a call of | ||
If \placeholder{L} is a \grammarterm{user-defined-floating-literal}, let \placeholder{f} be the | ||
literal without its \grammarterm{ud-suffix}. If \placeholder{S} contains a literal operator | ||
with parameter type \tcode{long double}, the literal \placeholder{L} is treated as a call of | ||
the form | ||
|
||
\begin{codeblock} | ||
operator "" @\term{X}@(@\term{f}@L) | ||
operator "" @\placeholder{X}@(@\placeholder{f}@L) | ||
\end{codeblock} | ||
|
||
Otherwise, \term{S} shall contain a raw literal operator or a literal operator | ||
template~(\ref{over.literal}) but not both. If \term{S} contains a raw literal operator, | ||
the \term{literal} \term{L} is treated as a call of the form | ||
Otherwise, \placeholder{S} shall contain a raw literal operator or a literal operator | ||
template~(\ref{over.literal}) but not both. If \placeholder{S} contains a raw literal operator, | ||
the \placeholder{literal} \placeholder{L} is treated as a call of the form | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. \term{literal} should be \grammarterm{literal}, not \placeholder |
||
\begin{codeblock} | ||
operator "" @\term{X}@(@"\term{f}{"}@) | ||
operator "" @\placeholder{X}@(@"\placeholder{f}{"}@) | ||
\end{codeblock} | ||
|
||
Otherwise (\term{S} contains a literal operator template), \term{L} is treated as a call | ||
Otherwise (\placeholder{S} contains a literal operator template), \placeholder{L} is treated as a call | ||
of the form | ||
|
||
\begin{codeblock} | ||
operator "" @\term{X}@<'@$c_1$@', '@$c_2$@', ... '@$c_k$@'>() | ||
operator "" @\placeholder{X}@<'@$c_1$@', '@$c_2$@', ... '@$c_k$@'>() | ||
\end{codeblock} | ||
|
||
where \term{f} is the source character sequence $c_1c_2...c_k$. \begin{note} The sequence | ||
where \placeholder{f} is the source character sequence $c_1c_2...c_k$. \begin{note} The sequence | ||
$c_1c_2...c_k$ can only contain characters from the basic source character set. | ||
\end{note} | ||
|
||
\pnum | ||
If \term{L} is a \grammarterm{user-defined-string-literal}, let \term{str} be the | ||
literal without its \grammarterm{ud-suffix} and let \term{len} be | ||
If \placeholder{L} is a \grammarterm{user-defined-string-literal}, let \placeholder{str} be the | ||
literal without its \grammarterm{ud-suffix} and let \placeholder{len} be | ||
the number of | ||
code units in \term{str} (i.e., its length excluding the terminating | ||
code units in \placeholder{str} (i.e., its length excluding the terminating | ||
null character). | ||
The literal \term{L} is treated as a call of the form | ||
The literal \placeholder{L} is treated as a call of the form | ||
|
||
\begin{codeblock} | ||
operator "" @\term{X}@(@\term{str}{}@, @\term{len}{}@) | ||
operator "" @\placeholder{X}@(@\placeholder{str}{}@, @\placeholder{len}{}@) | ||
\end{codeblock} | ||
|
||
\pnum | ||
If \term{L} is a \grammarterm{user-defined-character-literal}, let \term{ch} be the | ||
If \placeholder{L} is a \grammarterm{user-defined-character-literal}, let \placeholder{ch} be the | ||
literal without its \grammarterm{ud-suffix}. | ||
\term{S} shall contain a literal operator~(\ref{over.literal}) whose only parameter has | ||
the type of \term{ch} and the | ||
literal \term{L} is treated as a call | ||
\placeholder{S} shall contain a literal operator~(\ref{over.literal}) whose only parameter has | ||
the type of \placeholder{ch} and the | ||
literal \placeholder{L} is treated as a call | ||
of the form | ||
|
||
\begin{codeblock} | ||
operator "" @\term{X}@(@\term{ch}{}@) | ||
operator "" @\placeholder{X}@(@\placeholder{ch}{}@) | ||
\end{codeblock} | ||
|
||
\pnum | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have any rules when to use "POD~struct" vs. "POD struct" in the index? We seem to prefer the variant with the tilde = non-breaking space. If true, the stuff above needs to become \defnx.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change it to use tilde, so that we're covered if one day we want to render the index so narrowly that an entry consisting of 2 words side by side would get broken.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If being prepared for that is an actual goal, though, there are hundreds more occurrences that need to be replaced.