Skip to content

Commit 97e9aac

Browse files
authored
Update statement.dd
1 parent 5ebd458 commit 97e9aac

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

spec/statement.dd

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,10 @@ $(GNAME WhileStatement):
303303

304304
$(P A $(I While Statement) implements a simple loop.)
305305

306-
$(P If the $(IfCondition) is an $(EXPRESSION), it is evaluated and must have a type
307-
that can be converted to a boolean. If it's true the $(PSSCOPE) is executed.
308-
After the $(PSSCOPE) is executed, the $(EXPRESSION) is evaluated again, and
309-
if true the $(PSSCOPE) is executed again. This continues until the $(EXPRESSION)
310-
evaluates to false.)
306+
$(P $(EXPRESSION) is evaluated and must have a type that can be converted to a
307+
boolean. If it's true the $(PSSCOPE) is executed. After the $(PSSCOPE) is
308+
executed, the $(EXPRESSION) is evaluated again, and if true the $(PSSCOPE) is
309+
executed again. This continues until the $(EXPRESSION) evaluates to false.)
311310

312311
---
313312
int i = 0;
@@ -318,22 +317,15 @@ while (i < 10)
318317
}
319318
---
320319

321-
$(P If an $(D auto) $(I Identifier) is provided, it is declared and
322-
initialized to the value and type of the $(EXPRESSION). Its scope
323-
extends from when it is initialized to the end of the $(PSSCOPE).)
320+
$(P A $(GLINK BreakStatement) will exit the loop.)
324321

325-
$(P If a $(I TypeCtors) $(I Identifier) is provided, it is declared
326-
to be of the type specified by $(I TypeCtors) and is initialized with
327-
the value of the $(EXPRESSION). Its scope extends from when it is
328-
initialized to the end of the $(PSSCOPE).)
329-
330-
$(P If a $(I Declarator) is provided, it is declared and initialized
331-
to the value of the $(EXPRESSION). Its scope extends from when it is
332-
initialized to the end of the $(PSSCOPE).)
333-
334-
$(P A $(GLINK BreakStatement) will exit the loop.)
335-
336-
$(P A $(GLINK ContinueStatement) will transfer directly to evaluating $(IfCondition) again.)
322+
$(P A $(GLINK ContinueStatement) will transfer directly to evaluating $(EXPRESSION) again.)
323+
324+
$(P A $(I While Statement) is equivalent to:)
325+
326+
---
327+
for (; Expression; ) ScopeStatement
328+
---
337329

338330
$(H2 $(LEGACY_LNAME2 DoStatement, do-statement, Do Statement))
339331

0 commit comments

Comments
 (0)