@@ -1529,8 +1529,8 @@ $(GNAME PostfixExpression):
1529
1529
$(GSELF PostfixExpression) $(D .) $(GLINK NewExpression)
1530
1530
$(GSELF PostfixExpression) $(D ++)
1531
1531
$(GSELF PostfixExpression) $(D --)
1532
- $(GSELF PostfixExpression) $(D $(LPAREN)) $(GLINK ArgumentList )$(OPT) $(D $(RPAREN))
1533
- $(GLINK2 type, TypeCtors)$(OPT) $(GLINK2 type, BasicType) $(D $(LPAREN)) $(GLINK ArgumentList )$(OPT) $(D $(RPAREN))
1532
+ $(GSELF PostfixExpression) $(D $(LPAREN)) $(GLINK NamedArgumentList )$(OPT) $(D $(RPAREN))
1533
+ $(GLINK2 type, TypeCtors)$(OPT) $(GLINK2 type, BasicType) $(D $(LPAREN)) $(GLINK NamedArgumentList )$(OPT) $(D $(RPAREN))
1534
1534
$(GLINK IndexExpression)
1535
1535
$(GLINK SliceExpression)
1536
1536
)
@@ -1758,9 +1758,9 @@ $(GNAME PrimaryExpression):
1758
1758
$(GLINK2 type, FundamentalType) $(D .) $(IDENTIFIER)
1759
1759
$(D $(LPAREN)) $(GLINK2 type, Type) $(D $(RPAREN) .) $(IDENTIFIER)
1760
1760
$(D $(LPAREN)) $(GLINK2 type, Type) $(D $(RPAREN) .) $(GLINK2 template, TemplateInstance)
1761
- $(GLINK2 type, FundamentalType) $(D $(LPAREN)) $(GLINK ArgumentList )$(OPT) $(D $(RPAREN))
1761
+ $(GLINK2 type, FundamentalType) $(D $(LPAREN)) $(GLINK NamedArgumentList )$(OPT) $(D $(RPAREN))
1762
1762
$(GLINK2 type, TypeCtor) $(D $(LPAREN)) $(GLINK2 type, Type) $(D $(RPAREN)) $(D .) $(IDENTIFIER)
1763
- $(GLINK2 type, TypeCtor) $(D $(LPAREN)) $(GLINK2 type, Type) $(D $(RPAREN)) $(D $(LPAREN)) $(GLINK ArgumentList )$(OPT) $(D $(RPAREN))
1763
+ $(GLINK2 type, TypeCtor) $(D $(LPAREN)) $(GLINK2 type, Type) $(D $(RPAREN)) $(D $(LPAREN)) $(GLINK NamedArgumentList )$(OPT) $(D $(RPAREN))
1764
1764
$(GLINK2 type, Typeof)
1765
1765
$(GLINK TypeidExpression)
1766
1766
$(GLINK IsExpression)
@@ -2546,7 +2546,7 @@ $(GRAMMAR
2546
2546
$(GNAME NewExpression):
2547
2547
$(D new) $(GLINK2 type, Type)
2548
2548
$(D new) $(GLINK2 type, Type) $(D [) $(GLINK AssignExpression) $(D ])
2549
- $(D new) $(GLINK2 type, Type) $(D $(LPAREN)) $(GLINK ArgumentList )$(OPT) $(D $(RPAREN))
2549
+ $(D new) $(GLINK2 type, Type) $(D $(LPAREN)) $(GLINK NamedArgumentList )$(OPT) $(D $(RPAREN))
2550
2550
$(GLINK2 class, NewAnonClassExpression)
2551
2551
2552
2552
$(GNAME ArgumentList):
@@ -2555,15 +2555,24 @@ $(GNAME ArgumentList):
2555
2555
$(GLINK AssignExpression) $(D ,) $(GSELF ArgumentList)
2556
2556
)
2557
2557
2558
+ $(GNAME NamedArgumentList):
2559
+ $(GLINK NamedArgument)
2560
+ $(GLINK NamedArgument) $(D ,)
2561
+ $(GLINK NamedArgument) $(D ,) $(I NamedArgumentList)
2562
+
2563
+ $(GNAME NamedArgument):
2564
+ $(IDENTIFIER) $(D :) $(GLINK AssignExpression)
2565
+ $(GLINK AssignExpression)
2566
+
2558
2567
$(P $(I NewExpression)s allocate memory on the
2559
2568
$(DDLINK spec/garbage, Garbage Collection, garbage
2560
2569
collected) heap by default.
2561
2570
)
2562
2571
2563
2572
$(P The `new` *Type* form constructs an instance of a type and default-initializes it.)
2564
- $(P The *Type(ArgumentList )* form allows passing either a single initializer
2573
+ $(P The *Type(NamedArgumentList )* form allows passing either a single initializer
2565
2574
of the same type, or multiple arguments for more complex types.
2566
- For class types, *ArgumentList * is passed to the class constructor.
2575
+ For class types, *NamedArgumentList * is passed to the class constructor.
2567
2576
For a dynamic array, the argument sets the initial array length.
2568
2577
For multidimensional dynamic arrays, each argument corresponds to
2569
2578
an initial length (see $(RELATIVE_LINK2 new_multidimensional, below)).)
@@ -2585,7 +2594,7 @@ $(GNAME ArgumentList):
2585
2594
2586
2595
$(P The *Type[AssignExpression]* form allocates a dynamic array with
2587
2596
length equal to *AssignExpression*.
2588
- It is preferred to use the *Type(ArgumentList )* form when allocating
2597
+ It is preferred to use the *Type(NamedArgumentList )* form when allocating
2589
2598
dynamic arrays instead, as it is more general.)
2590
2599
2591
2600
$(NOTE It is not possible to allocate a static array directly with
0 commit comments