Skip to content

Commit 52ce838

Browse files
WalterBrightGeod24
authored andcommitted
add scope to foreach iteration symbols
1 parent 221b779 commit 52ce838

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

spec/statement.dd

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,9 +471,10 @@ $(GNAME ForeachTypeAttributes):
471471
$(GLINK ForeachTypeAttribute) $(GSELF ForeachTypeAttributes)
472472

473473
$(GNAME ForeachTypeAttribute):
474+
$(D enum)
474475
$(D ref)
476+
$(D scope)
475477
$(GLINK2 type, TypeCtor)
476-
$(D enum)
477478

478479
$(GNAME ForeachAggregate):
479480
$(EXPRESSION)
@@ -488,8 +489,10 @@ $(P
488489
At the start of each iteration, the variables declared by
489490
the $(I ForeachTypeList)
490491
are set to be a copy of the elements of the aggregate.
491-
If the variable is $(D ref), it is a reference to the
492+
If the $(I ForeachTypeAttribute) is $(D ref), it is a reference to the
492493
contents of that aggregate.
494+
If the $(I ForeachTypeAttribute) is $(D scope), the $(I ForeachType) declaration
495+
will have $(D scope) semantics.
493496
)
494497
$(P
495498
The aggregate must be loop invariant, meaning that

0 commit comments

Comments
 (0)