Skip to content
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

[stmt.do] Add grammar equivalence and reorder paragraphs #6495

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
22 changes: 17 additions & 5 deletions source/statements.tex
Original file line number Diff line number Diff line change
Expand Up @@ -595,13 +595,25 @@
\indextext{statement!\idxcode{do}}

\pnum
The expression is contextually converted to \tcode{bool}\iref{conv};
if that conversion is ill-formed, the program is ill-formed.
In the \keyword{do} statement the substatement is executed repeatedly
until the value of the \grammarterm{expression} becomes \tcode{false}.
The test takes place after each execution of the statement.

\pnum
In the \keyword{do} statement the substatement is executed repeatedly
until the value of the expression becomes \tcode{false}. The test takes
place after each execution of the statement.
The \keyword{do} statement
\begin{ncsimplebnf}
\keyword{do} statement \keyword{while} \terminal{(} expression \terminal{)} \terminal{;}
\end{ncsimplebnf}
is equivalent to
\begin{ncsimplebnf}
\exposid{label} \terminal{:}\br
\terminal{\{}\br
\bnfindent statement\br
\bnfindent \keyword{if} \terminal{(} expression \terminal{)} \terminal{\{}\br
\bnfindent \bnfindent \keyword{goto} \exposid{label} \terminal{;}\br
\bnfindent \terminal{\}}\br
\terminal{\}}
\end{ncsimplebnf}

\rSec2[stmt.for]{The \tcode{for} statement}%
\indextext{statement!\idxcode{for}}
Expand Down