Skip to content

[stmt.while] Add grammar #6494

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions source/statements.tex
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,11 @@

\pnum
\indextext{statement!declaration in \tcode{while}}%
A \keyword{while} statement is equivalent to
A \keyword{while} statement
\begin{ncsimplebnf}
\keyword{while} \terminal{(} condition \terminal{)} statement
\end{ncsimplebnf}
is equivalent to
\begin{ncsimplebnf}
\exposid{label} \terminal{:}\br
\terminal{\{}\br
Expand All @@ -569,8 +573,8 @@
\terminal{\}}
\end{ncsimplebnf}
\begin{note}
The variable created in the condition is destroyed and created with each
iteration of the loop.
The variable created in the \grammarterm{condition}
is destroyed and created with each iteration of the loop.
\begin{example}
\begin{codeblock}
struct A {
Expand All @@ -586,8 +590,8 @@
}
\end{codeblock}
In the while-loop, the constructor and destructor are each called twice,
once for the condition that succeeds and once for the condition that
fails.
once for the \grammarterm{condition} that succeeds and
once for the \grammarterm{condition} that fails.
\end{example}
\end{note}

Expand Down