Skip to content

Commit 05e7f8c

Browse files
ntreldlang-bot
authored andcommitted
Tweak static foreach docs
Reorder grammar more usually. Add link to ForeachType for variables. Fixes #4109.
1 parent fc2be54 commit 05e7f8c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

spec/version.dd

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -601,16 +601,16 @@ Int!(17) c; // error, static assert trips
601601
$(H2 $(LNAME2 staticforeach, Static Foreach))
602602

603603
$(GRAMMAR
604-
$(GNAME StaticForeach):
605-
$(D static) $(GLINK2 statement, AggregateForeach)
606-
$(D static) $(GLINK2 statement, RangeForeach)
607-
608604
$(GNAME StaticForeachDeclaration):
609605
$(GLINK StaticForeach) $(GLINK2 attribute, DeclarationBlock)
610606
$(GLINK StaticForeach) $(D :) $(GLINK2 module, DeclDefs)$(OPT)
611607

612608
$(GNAME StaticForeachStatement):
613609
$(GLINK StaticForeach) $(GLINK2 statement, NoScopeNonEmptyStatement)
610+
611+
$(GNAME StaticForeach):
612+
$(D static) $(GLINK2 statement, AggregateForeach)
613+
$(D static) $(GLINK2 statement, RangeForeach)
614614
)
615615

616616
$(P `static foreach` expands its *DeclarationBlock* or *DeclDefs* into a
@@ -639,7 +639,8 @@ static foreach (i; [0, 1, 2, 3])
639639
------
640640
)
641641

642-
$(P $(D static foreach) supports multiple variables in cases where the
642+
$(P $(D static foreach) supports multiple $(GLINK2 statement, ForeachType)
643+
variables in cases where the
643644
corresponding $(D foreach) statement supports them. (In this case,
644645
$(D static foreach) generates a compile-time sequence of tuples, and the
645646
tuples are subsequently unpacked during iteration).

0 commit comments

Comments
 (0)