Skip to content

Commit 99325f3

Browse files
Eelistkoeppe
authored andcommitted
[cpp, lex, over] Make bnf indentation in source match presentation. (#2035)
1 parent b5b65ed commit 99325f3

File tree

3 files changed

+30
-30
lines changed

3 files changed

+30
-30
lines changed

source/lex.tex

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -796,15 +796,15 @@
796796
%% Ed. note: character protrusion would misalign various operators.
797797
\microtypesetup{protrusion=false}\obeyspaces
798798
\nontermdef{preprocessing-op-or-punc} \textnormal{one of}\br
799-
\terminal{\{ \} [ ] \# \#\# ( )}\br
800-
\terminal{<: :> <\% \%> \%: \%:\%: ; : ...}\br
801-
\terminal{new delete ? :: . .* -> ->* \~}\br
802-
\terminal{! + - * / \% \caret{} \& |}\br
803-
\terminal{= += -= *= /= \%= \caret{}= \&= |=}\br
804-
\terminal{== != < > <= >= <=> \&\& ||}\br
805-
\terminal{<< >> <<= >>= ++ -- ,}\br
806-
\terminal{and or xor not bitand bitor compl}\br
807-
\terminal{and_eq or_eq xor_eq not_eq}
799+
\terminal{\{ \} [ ] \# \#\# ( )}\br
800+
\terminal{<: :> <\% \%> \%: \%:\%: ; : ...}\br
801+
\terminal{new delete ? :: . .* -> ->* \~}\br
802+
\terminal{! + - * / \% \caret{} \& |}\br
803+
\terminal{= += -= *= /= \%= \caret{}= \&= |=}\br
804+
\terminal{== != < > <= >= <=> \&\& ||}\br
805+
\terminal{<< >> <<= >>= ++ -- ,}\br
806+
\terminal{and or xor not bitand bitor compl}\br
807+
\terminal{and_eq or_eq xor_eq not_eq}
808808
\end{bnf}
809809

810810
Each \grammarterm{preprocessing-op-or-punc} is converted to a single token

source/overloading.tex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3077,11 +3077,11 @@
30773077
%% Ed. note: character protrusion would misalign various operators.
30783078
\microtypesetup{protrusion=false}\obeyspaces
30793079
\nontermdef{operator} \textnormal{one of}\br
3080-
\terminal{new delete new[] delete[] (\rlap{\,)} [\rlap{\,]} -> ->* \~}\br
3081-
\terminal{! + - * / \% \caret{} \& |}\br
3082-
\terminal{= += -= *= /= \%= \caret{}= \&= |=}\br
3083-
\terminal{== != < > <= >= <=> \&\& ||}\br
3084-
\terminal{<< >> <<= >>= ++ -- ,}\br
3080+
\terminal{new delete new[] delete[] (\rlap{\,)} [\rlap{\,]} -> ->* \~}\br
3081+
\terminal{! + - * / \% \caret{} \& |}\br
3082+
\terminal{= += -= *= /= \%= \caret{}= \&= |=}\br
3083+
\terminal{== != < > <= >= <=> \&\& ||}\br
3084+
\terminal{<< >> <<= >>= ++ -- ,}\br
30853085
\end{bnf}
30863086
\begin{note}
30873087
The last two operators are function call\iref{expr.call}

source/preprocessor.tex

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@
4949

5050
\begin{bnf}\obeyspaces
5151
\nontermdef{control-line}\br
52-
\terminal{\# include} pp-tokens new-line\br
53-
\terminal{\# define } identifier replacement-list new-line\br
54-
\terminal{\# define } identifier lparen \opt{identifier-list} \terminal{)} replacement-list new-line\br
55-
\terminal{\# define } identifier lparen \terminal{... )} replacement-list new-line\br
56-
\terminal{\# define } identifier lparen identifier-list \terminal{, ... )} replacement-list new-line\br
57-
\terminal{\# undef } identifier new-line\br
58-
\terminal{\# line } pp-tokens new-line\br
59-
\terminal{\# error } \opt{pp-tokens} new-line\br
60-
\terminal{\# pragma } \opt{pp-tokens} new-line\br
61-
\terminal{\# }new-line
52+
\terminal{\# include} pp-tokens new-line\br
53+
\terminal{\# define } identifier replacement-list new-line\br
54+
\terminal{\# define } identifier lparen \opt{identifier-list} \terminal{)} replacement-list new-line\br
55+
\terminal{\# define } identifier lparen \terminal{... )} replacement-list new-line\br
56+
\terminal{\# define } identifier lparen identifier-list \terminal{, ... )} replacement-list new-line\br
57+
\terminal{\# undef } identifier new-line\br
58+
\terminal{\# line } pp-tokens new-line\br
59+
\terminal{\# error } \opt{pp-tokens} new-line\br
60+
\terminal{\# pragma } \opt{pp-tokens} new-line\br
61+
\terminal{\# }new-line
6262
\end{bnf}
6363

6464
\begin{bnf}
@@ -68,9 +68,9 @@
6868

6969
\begin{bnf}\obeyspaces
7070
\nontermdef{if-group}\br
71-
\terminal{\# if } constant-expression new-line \opt{group}\br
72-
\terminal{\# ifdef } identifier new-line \opt{group}\br
73-
\terminal{\# ifndef } identifier new-line \opt{group}
71+
\terminal{\# if } constant-expression new-line \opt{group}\br
72+
\terminal{\# ifdef } identifier new-line \opt{group}\br
73+
\terminal{\# ifndef } identifier new-line \opt{group}
7474
\end{bnf}
7575

7676
\begin{bnf}
@@ -81,17 +81,17 @@
8181

8282
\begin{bnf}\obeyspaces
8383
\nontermdef{elif-group}\br
84-
\terminal{\# elif } constant-expression new-line \opt{group}
84+
\terminal{\# elif } constant-expression new-line \opt{group}
8585
\end{bnf}
8686

8787
\begin{bnf}\obeyspaces
8888
\nontermdef{else-group}\br
89-
\terminal{\# else } new-line \opt{group}
89+
\terminal{\# else } new-line \opt{group}
9090
\end{bnf}
9191

9292
\begin{bnf}\obeyspaces
9393
\nontermdef{endif-line}\br
94-
\terminal{\# endif } new-line
94+
\terminal{\# endif } new-line
9595
\end{bnf}
9696

9797
\begin{bnf}

0 commit comments

Comments
 (0)