diff --git a/source/classes.tex b/source/classes.tex index 325d3f36c4..46dd1496a1 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -5740,7 +5740,6 @@ \end{codeblock} \end{example} \begin{note} -\setlength{\emergencystretch}{1em} The initialization performed by each \grammarterm{mem-initializer} constitutes a full-expres\-sion\iref{intro.execution}. diff --git a/source/declarations.tex b/source/declarations.tex index ffd9809b11..18745f94b7 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -6251,7 +6251,7 @@ A coroutine behaves as if its \grammarterm{function-body} were replaced by: \begin{ncsimplebnf} \terminal{\{}\br -\bnfindent promise-type \exposid{promise} promise-constructor-arguments \terminal{;}\br +\bnfindent \placeholder{promise-type} \exposid{promise} \placeholder{promise-constructor-arguments} \terminal{;}\br % FIXME: \bnfindent \exposid{promise}\terminal{.get_return_object()} \terminal{;} % ... except that it's not a discarded-value expression \bnfindent \terminal{co_await} \terminal{\exposid{promise}.initial_suspend()} \terminal{;}\br diff --git a/source/macros.tex b/source/macros.tex index c43cd373cb..0f26798771 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -202,9 +202,10 @@ \newcommand{\CodeStyle}{\ttfamily} \newcommand{\CodeStylex}[1]{\texttt{#1}} +\definecolor{grammar-gray}{gray}{0.2} + % General grammar style -\newcommand{\GrammarStyle}{\itfamily} -\newcommand{\GrammarStylex}[1]{\textit{#1}} +\newcommand{\GrammarStylex}[1]{\textcolor{grammar-gray}{\textsf{\textit{#1}}}} % Code and definitions embedded in text. \newcommand{\tcode}[1]{\CodeStylex{#1}} @@ -214,7 +215,7 @@ \newcommand{\keyword}[1]{\tcode{#1}\indextext{\idxcode{#1}}} \newcommand{\grammarterm}[1]{\indexgram{\idxgram{#1}}\gterm{#1}} \newcommand{\grammartermnc}[1]{\indexgram{\idxgram{#1}}\gterm{#1\nocorr}} -\newcommand{\regrammarterm}[1]{\gterm{#1}} +\newcommand{\regrammarterm}[1]{\textit{#1}} \newcommand{\placeholder}[1]{\textit{#1}} \newcommand{\placeholdernc}[1]{\textit{#1\nocorr}} \newcommand{\exposid}[1]{\tcode{\placeholder{#1}}} @@ -240,7 +241,7 @@ \newcommand{\CppXI}{\Cpp{} 2011} \newcommand{\CppXIV}{\Cpp{} 2014} \newcommand{\CppXVII}{\Cpp{} 2017} -\newcommand{\opt}[1]{#1\ensuremath{_\mathit{opt}}} +\newcommand{\opt}[1]{#1\ensuremath{_\mathit{\color{black}opt}}} \newcommand{\dcr}{-{-}} \newcommand{\bigoh}[1]{\ensuremath{\mathscr{O}(#1)}} @@ -526,16 +527,17 @@ \setlength{\BnfInc}{\BnfIndent} \newlength{\BnfRest} \setlength{\BnfRest}{2\BnfIndent} -\newcommand{\BnfNontermshape}{\small\rmfamily\itshape} +\newcommand{\BnfNontermshape}{\small\color{grammar-gray}\sffamily\itshape} +\newcommand{\BnfReNontermshape}{\small\rmfamily\itshape} \newcommand{\BnfTermshape}{\small\ttfamily\upshape} \newenvironment{bnfbase} { \newcommand{\nontermdef}[1]{{\BnfNontermshape##1\itcorr}\indexgrammar{\idxgram{##1}}\textnormal{:}} - \newcommand{\renontermdef}[1]{{\BnfNontermshape##1\itcorr}\,\textnormal{::}} \newcommand{\terminal}[1]{{\BnfTermshape ##1}} \renewcommand{\keyword}[1]{\terminal{##1}\indextext{\idxcode{##1}}} - \renewcommand{\exposid}[1]{\terminal{\placeholder{##1}}} + \renewcommand{\exposid}[1]{\terminal{\textit{##1}}} + \renewcommand{\placeholder}[1]{\textrm{\textit{##1}}} \newcommand{\descr}[1]{\textnormal{##1}} \newcommand{\bnfindent}{\hspace*{\bnfindentfirst}} \newcommand{\bnfindentfirst}{\BnfIndent} @@ -572,6 +574,19 @@ \end{bnfbase} } +\newenvironment{ncrebnf} +{ + \begin{bnfbase} + \newcommand{\renontermdef}[1]{{\BnfReNontermshape##1\itcorr}\,\textnormal{::}} + \begin{bnflist} + \BnfReNontermshape + \item\relax +} +{ + \end{bnflist} + \end{bnfbase} +} + % non-copied versions of bnf environments \let\ncsimplebnf\simplebnf \let\endncsimplebnf\endsimplebnf diff --git a/source/regex.tex b/source/regex.tex index 7fd308d2da..66068beef2 100644 --- a/source/regex.tex +++ b/source/regex.tex @@ -3680,7 +3680,7 @@ \pnum The following productions within the ECMAScript grammar are modified as follows: -\begin{ncbnf} +\begin{ncrebnf} \renontermdef{ClassAtom}\br \terminal{-}\br ClassAtomNoDash\br @@ -3690,12 +3690,12 @@ \renontermdef{IdentityEscape}\br SourceCharacter \textnormal{\textbf{but not}} \terminal{c} -\end{ncbnf} +\end{ncrebnf} \pnum The following new productions are then added: -\begin{ncbnf} +\begin{ncrebnf} \renontermdef{ClassAtomExClass}\br \terminal{[:} ClassName \terminal{:]} @@ -3711,7 +3711,7 @@ \renontermdef{ClassNameCharacter}\br SourceCharacter \textnormal{\textbf{but not one of}} \terminal{.} \textnormal{\textbf{or}} \terminal{=} \textnormal{\textbf{or}} \terminal{:} -\end{ncbnf} +\end{ncrebnf} \pnum The productions \regrammarterm{ClassAtomExClass}, \regrammarterm{ClassAtomCollatingElement} diff --git a/source/std.tex b/source/std.tex index f8da262ef6..3c69837f4a 100644 --- a/source/std.tex +++ b/source/std.tex @@ -26,6 +26,7 @@ \usepackage[final]{microtype} \usepackage{multicol} \usepackage{lmodern} +\usepackage{xcolor} \usepackage[T1]{fontenc} \usepackage[pdftex, final]{graphicx} \usepackage[pdftex,