Skip to content

Commit e65a242

Browse files
ntreldlang-bot
authored andcommitted
[statement.dd] Tweak ForStatement docs
1 parent 703033e commit e65a242

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

spec/statement.dd

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -385,12 +385,12 @@ $(GNAME Increment):
385385

386386
$(P $(I Initialize) is executed.
387387
$(I Test) is evaluated and must have a type that
388-
can be converted to a boolean. If it's true the
389-
statement is executed. After the statement is executed,
390-
the $(I Increment) is executed.
391-
Then $(I Test) is evaluated again, and if true the
392-
statement is executed again. This continues until the
393-
$(I Test) evaluates to false.
388+
can be converted to a boolean. If *Test* is `true` the
389+
*ScopeStatement* is executed. After execution,
390+
$(I Increment) is executed.
391+
Then $(I Test) is evaluated again, and if `true` the
392+
*ScopeStatement* is executed again. This continues until the
393+
$(I Test) evaluates to `false`.
394394
)
395395

396396
$(P A $(GLINK BreakStatement) will exit the loop.
@@ -400,7 +400,7 @@ $(GNAME Increment):
400400

401401
$(P A $(I ForStatement) creates a new scope.
402402
If $(I Initialize) declares a variable, that variable's scope
403-
extends through the end of the for statement. For example:
403+
extends through *ScopeStatement*. For example:
404404
)
405405

406406
--------------
@@ -418,7 +418,7 @@ for (int i = 0; i < 10; i++)
418418
}
419419
--------------
420420

421-
$(P Function bodies cannot be empty:)
421+
$(P *ScopeStatement* cannot be an empty statement:)
422422

423423
--------------
424424
for (int i = 0; i < 10; i++)
@@ -433,9 +433,9 @@ for (int i = 0; i < 10; i++)
433433
}
434434
--------------
435435

436-
$(P The $(I Initialize) may be omitted (although the trailing $(D ;) is still required).
437-
$(I Test) may also be omitted, and if
438-
so, it is treated as if it evaluated to true.)
436+
$(P $(I Initialize) may be just $(D ;).
437+
$(I Test) may be omitted, and if
438+
so, it is treated as if it evaluated to `true`.)
439439

440440
$(BEST_PRACTICE Consider replacing $(I ForStatements) with
441441
$(DDSUBLINK spec/statement, foreach-statement, Foreach Statements) or

0 commit comments

Comments
 (0)