Skip to content

Commit 20adffb

Browse files
authored
Fast follow on renumbering (#1275)
AFter #1247 was merged, fixup section numbers by hand. I did run all the tools locally, as a test.
1 parent afbf099 commit 20adffb

10 files changed

+42
-42
lines changed

standard/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -346,12 +346,12 @@
346346
- [§12.8.17](expressions.md#12817-the-new-operator) The new operator
347347
- [§12.8.17.1](expressions.md#128171-general) General
348348
- [§12.8.17.2](expressions.md#128172-object-creation-expressions) Object creation expressions
349-
- [§12.8.17.2.1](§NewGeneral) General
349+
- [§12.8.17.2.1](expressions.md#1281721-general) General
350350
- [§12.8.17.2.2](expressions.md#1281722-object-initializers) Object initializers
351351
- [§12.8.17.2.3](expressions.md#1281723-collection-initializers) Collection initializers
352-
- [§12.8.17.2.4](expressions.md#1281724-anonymous-object-creation-expressions) Anonymous object creation expressions
353-
- [§12.8.17.3](expressions.md#128173-array-creation-expressions) Array creation expressions
354-
- [§12.8.17.4](expressions.md#128174-delegate-creation-expressions) Delegate creation expressions
352+
- [§12.8.17.3](expressions.md#128173-anonymous-object-creation-expressions) Anonymous object creation expressions
353+
- [§12.8.17.4](expressions.md#128174-array-creation-expressions) Array creation expressions
354+
- [§12.8.17.5](expressions.md#128175-delegate-creation-expressions) Delegate creation expressions
355355
- [§12.8.18](expressions.md#12818-the-typeof-operator) The typeof operator
356356
- [§12.8.19](expressions.md#12819-the-sizeof-operator) The sizeof operator
357357
- [§12.8.20](expressions.md#12820-the-checked-and-unchecked-operators) The checked and unchecked operators

standard/arrays.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ When an array type `S[]` implements `IList<T>`, some of the members of the imple
102102
103103
## 17.3 Array creation
104104
105-
Array instances are created by *array_creation_expression*s ([§12.8.17.3](expressions.md#128173-array-creation-expressions)) or by field or local variable declarations that include an *array_initializer* ([§17.7](arrays.md#177-array-initializers)). Array instances can also be created implicitly as part of evaluating an argument list involving a parameter array ([§15.6.2.4](classes.md#15624-parameter-arrays)).
105+
Array instances are created by *array_creation_expression*s ([§12.8.17.4](expressions.md#128174-array-creation-expressions)) or by field or local variable declarations that include an *array_initializer* ([§17.7](arrays.md#177-array-initializers)). Array instances can also be created implicitly as part of evaluating an argument list involving a parameter array ([§15.6.2.4](classes.md#15624-parameter-arrays)).
106106
107107
When an array instance is created, the rank and length of each dimension are established and then remain constant for the entire lifetime of the instance. In other words, it is not possible to change the rank of an existing array instance, nor is it possible to resize its dimensions.
108108
@@ -158,7 +158,7 @@ Array covariance specifically does not extend to arrays of *value_type*s. For ex
158158
159159
## 17.7 Array initializers
160160
161-
Array initializers may be specified in field declarations ([§15.5](classes.md#155-fields)), local variable declarations ([§13.6.2](statements.md#1362-local-variable-declarations)), and array creation expressions ([§12.8.17.3](expressions.md#128173-array-creation-expressions)):
161+
Array initializers may be specified in field declarations ([§15.5](classes.md#155-fields)), local variable declarations ([§13.6.2](statements.md#1362-local-variable-declarations)), and array creation expressions ([§12.8.17.4](expressions.md#128174-array-creation-expressions)):
162162
163163
```ANTLR
164164
array_initializer

standard/classes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3015,7 +3015,7 @@ If an implementing declaration exists for a given partial method, the invocation
30153015
30163016
If a defining declaration but not an implementing declaration is given for a partial method `M`, the following restrictions apply:
30173017
3018-
- It is a compile-time error to create a delegate from `M` ([§12.8.17.4](expressions.md#128174-delegate-creation-expressions)).
3018+
- It is a compile-time error to create a delegate from `M` ([§12.8.17.5](expressions.md#128175-delegate-creation-expressions)).
30193019
30203020
- It is a compile-time error to refer to `M` inside an anonymous function that is converted to an expression tree type ([§8.6](types.md#86-expression-tree-types)).
30213021

standard/conversions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ Anonymous functions may influence overload resolution, and participate in type i
849849
850850
### 10.7.2 Evaluation of anonymous function conversions to delegate types
851851
852-
Conversion of an anonymous function to a delegate type produces a delegate instance that references the anonymous function and the (possibly empty) set of captured outer variables that are active at the time of the evaluation. When the delegate is invoked, the body of the anonymous function is executed. The code in the body is executed using the set of captured outer variables referenced by the delegate. A *delegate_creation_expression* ([§12.8.17.4](expressions.md#128174-delegate-creation-expressions)) can be used as an alternate syntax for converting an anonymous method to a delegate type.
852+
Conversion of an anonymous function to a delegate type produces a delegate instance that references the anonymous function and the (possibly empty) set of captured outer variables that are active at the time of the evaluation. When the delegate is invoked, the body of the anonymous function is executed. The code in the body is executed using the set of captured outer variables referenced by the delegate. A *delegate_creation_expression* ([§12.8.17.5](expressions.md#128175-delegate-creation-expressions)) can be used as an alternate syntax for converting an anonymous method to a delegate type.
853853
854854
The invocation list of a delegate produced from an anonymous function contains a single entry. The exact target object and target method of the delegate are unspecified. In particular, it is unspecified whether the target object of the delegate is `null`, the `this` value of the enclosing function member, or some other object.
855855

standard/delegates.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,11 @@ This definition of compatibility allows covariance in return type and contravari
178178
179179
## 20.5 Delegate instantiation
180180
181-
An instance of a delegate is created by a *delegate_creation_expression* ([§12.8.17.4](expressions.md#128174-delegate-creation-expressions)), a conversion to a delegate type, delegate combination or delegate removal. The newly created delegate instance then refers to one or more of:
181+
An instance of a delegate is created by a *delegate_creation_expression* ([§12.8.17.5](expressions.md#128175-delegate-creation-expressions)), a conversion to a delegate type, delegate combination or delegate removal. The newly created delegate instance then refers to one or more of:
182182
183183
- The static method referenced in the *delegate_creation_expression*, or
184184
- The target object (which cannot be `null`) and instance method referenced in the *delegate_creation_expression*, or
185-
- Another delegate ([§12.8.17.4](expressions.md#128174-delegate-creation-expressions)).
185+
- Another delegate ([§12.8.17.5](expressions.md#128175-delegate-creation-expressions)).
186186
187187
> *Example*:
188188
>
@@ -212,7 +212,7 @@ An instance of a delegate is created by a *delegate_creation_expression* ([§12.
212212
213213
The set of methods encapsulated by a delegate instance is called an *invocation list*. When a delegate instance is created from a single method, it encapsulates that method, and its invocation list contains only one entry. However, when two non-`null` delegate instances are combined, their invocation lists are concatenatedin the order left operand then right operandto form a new invocation list, which contains two or more entries.
214214
215-
When a new delegate is created from a single delegate the resultant invocation list has just one entry, which is the source delegate ([§12.8.17.4](expressions.md#128174-delegate-creation-expressions)).
215+
When a new delegate is created from a single delegate the resultant invocation list has just one entry, which is the source delegate ([§12.8.17.5](expressions.md#128175-delegate-creation-expressions)).
216216
217217
Delegates are combined using the binary `+` ([§12.10.5](expressions.md#12105-addition-operator)) and `+=` operators ([§12.21.4](expressions.md#12214-compound-assignment)). A delegate can be removed from a combination of delegates, using the binary `-` ([§12.10.6](expressions.md#12106-subtraction-operator)) and `-=` operators ([§12.21.4](expressions.md#12214-compound-assignment)). Delegates can be compared for equality ([§12.12.9](expressions.md#12129-delegate-equality-operators)).
218218

standard/expressions.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ For expressions which occur as subexpressions of larger expressions, with the no
2323

2424
- A namespace. An expression with this classification can only appear as the left-hand side of a *member_access* ([§12.8.7](expressions.md#1287-member-access)). In any other context, an expression classified as a namespace causes a compile-time error.
2525
- A type. An expression with this classification can only appear as the left-hand side of a *member_access* ([§12.8.7](expressions.md#1287-member-access)). In any other context, an expression classified as a type causes a compile-time error.
26-
- A method group, which is a set of overloaded methods resulting from a member lookup ([§12.5](expressions.md#125-member-lookup)). A method group may have an associated instance expression and an associated type argument list. When an instance method is invoked, the result of evaluating the instance expression becomes the instance represented by `this` ([§12.8.14](expressions.md#12814-this-access)). A method group is permitted in an *invocation_expression* ([§12.8.10](expressions.md#12810-invocation-expressions)) or a *delegate_creation_expression* ([§12.8.17.4](expressions.md#128174-delegate-creation-expressions)), and can be implicitly converted to a compatible delegate type ([§10.8](conversions.md#108-method-group-conversions)). In any other context, an expression classified as a method group causes a compile-time error.
26+
- A method group, which is a set of overloaded methods resulting from a member lookup ([§12.5](expressions.md#125-member-lookup)). A method group may have an associated instance expression and an associated type argument list. When an instance method is invoked, the result of evaluating the instance expression becomes the instance represented by `this` ([§12.8.14](expressions.md#12814-this-access)). A method group is permitted in an *invocation_expression* ([§12.8.10](expressions.md#12810-invocation-expressions)) or a *delegate_creation_expression* ([§12.8.17.5](expressions.md#128175-delegate-creation-expressions)), and can be implicitly converted to a compatible delegate type ([§10.8](conversions.md#108-method-group-conversions)). In any other context, an expression classified as a method group causes a compile-time error.
2727
- An event access. Every event access has an associated type, namely the type of the event. Furthermore, an event access may have an associated instance expression. An event access may appear as the left operand of the `+=` and `-=` operators ([§12.21.5](expressions.md#12215-event-assignment)). In any other context, an expression classified as an event access causes a compile-time error. When an accessor of an instance event access is invoked, the result of evaluating the instance expression becomes the instance represented by `this` ([§12.8.14](expressions.md#12814-this-access)).
2828
- A throw expression, which may be used in several contexts to throw an exception in an expression. A throw expression may be converted by an implicit conversion to any type.
2929

@@ -685,7 +685,7 @@ The expressions of an argument list are always evaluated in textual order.
685685
>
686686
> *end example*
687687
688-
When a function member with a parameter array is invoked in its expanded form with at least one expanded argument, the invocation is processed as if an array creation expression with an array initializer ([§12.8.17.3](expressions.md#128173-array-creation-expressions)) was inserted around the expanded arguments. An empty array is passed when there are no arguments for the parameter array; it is unspecified whether the reference passed is to a newly allocated or existing empty array.
688+
When a function member with a parameter array is invoked in its expanded form with at least one expanded argument, the invocation is processed as if an array creation expression with an array initializer ([§12.8.17.4](expressions.md#128174-array-creation-expressions)) was inserted around the expanded arguments. An empty array is passed when there are no arguments for the parameter array; it is unspecified whether the reference passed is to a newly allocated or existing empty array.
689689
690690
> *Example*: Given the declaration
691691
>
@@ -1822,7 +1822,7 @@ A *null_conditional_member_access* expression `E` is of the form `P?.A`. The me
18221822
>
18231823
> *end note*
18241824

1825-
A *null_conditional_projection_initializer* is a restriction of *null_conditional_member_access* and has the same semantics. It only occurs as a projection initializer in an anonymous object creation expression ([§12.8.17.2.4](expressions.md#1281724-anonymous-object-creation-expressions)).
1825+
A *null_conditional_projection_initializer* is a restriction of *null_conditional_member_access* and has the same semantics. It only occurs as a projection initializer in an anonymous object creation expression ([§12.8.17.3](expressions.md#128173-anonymous-object-creation-expressions)).
18261826

18271827
### 12.8.9 Null-forgiving expressions
18281828

@@ -2424,7 +2424,7 @@ The `new` operator implies creation of an instance of a type, but does not neces
24242424
24252425
#### 12.8.17.2 Object creation expressions
24262426

2427-
##### §NewGeneral General
2427+
##### 12.8.17.2.1 General
24282428

24292429
An *object_creation_expression* is used to create a new instance of a *class_type* or a *value_type*.
24302430

@@ -2714,7 +2714,7 @@ The collection object to which a collection initializer is applied shall be of a
27142714
>
27152715
> *end example*
27162716
2717-
#### 12.8.17.2.4 Anonymous object creation expressions
2717+
#### 12.8.17.3 Anonymous object creation expressions
27182718
27192719
An *anonymous_object_creation_expression* is used to create an object of an anonymous type.
27202720
@@ -2803,7 +2803,7 @@ are precisely equivalent to the following, respectively:
28032803
28042804
Thus, in a projection initializer the identifier selects both the value and the field or property to which the value is assigned. Intuitively, a projection initializer projects not just a value, but also the name of the value.
28052805
2806-
#### 12.8.17.3 Array creation expressions
2806+
#### 12.8.17.4 Array creation expressions
28072807
28082808
An *array_creation_expression* is used to create a new instance of an *array_type*.
28092809
@@ -2910,7 +2910,7 @@ An array creation expression permits instantiation of an array with elements of
29102910
>
29112911
> *end example*
29122912
2913-
Implicitly typed array creation expressions can be combined with anonymous object initializers ([§12.8.17.2.4](expressions.md#1281724-anonymous-object-creation-expressions)) to create anonymously typed data structures.
2913+
Implicitly typed array creation expressions can be combined with anonymous object initializers ([§12.8.17.3](expressions.md#128173-anonymous-object-creation-expressions)) to create anonymously typed data structures.
29142914
29152915
> *Example*:
29162916
>
@@ -2933,7 +2933,7 @@ Implicitly typed array creation expressions can be combined with anonymous objec
29332933
>
29342934
> *end example*
29352935
2936-
#### 12.8.17.4 Delegate creation expressions
2936+
#### 12.8.17.5 Delegate creation expressions
29372937
29382938
A *delegate_creation_expression* is used to obtain an instance of a *delegate_type*.
29392939
@@ -2945,7 +2945,7 @@ delegate_creation_expression
29452945
29462946
The argument of a delegate creation expression shall be a method group, an anonymous function, or a value of either the compile-time type `dynamic` or a *delegate_type*. If the argument is a method group, it identifies the method and, for an instance method, the object for which to create a delegate. If the argument is an anonymous function it directly defines the parameters and method body of the delegate target. If the argument is a value it identifies a delegate instance of which to create a copy.
29472947

2948-
If the *expression* has the compile-time type `dynamic`, the *delegate_creation_expression* is dynamically bound ([§12.8.17.4](expressions.md#128174-delegate-creation-expressions)), and the rules below are applied at run-time using the run-time type of the *expression*. Otherwise, the rules are applied at compile-time.
2948+
If the *expression* has the compile-time type `dynamic`, the *delegate_creation_expression* is dynamically bound ([§12.8.17.5](expressions.md#128175-delegate-creation-expressions)), and the rules below are applied at run-time using the run-time type of the *expression*. Otherwise, the rules are applied at compile-time.
29492949

29502950
The binding-time processing of a *delegate_creation_expression* of the form new `D(E)`, where `D` is a *delegate_type* and `E` is an *expression*, consists of the following steps:
29512951

@@ -6808,7 +6808,7 @@ Constant expressions are required in the contexts listed below and this is indic
68086808
- Default arguments of parameter lists ([§15.6.2](classes.md#1562-method-parameters))
68096809
- `case` labels of a `switch` statement ([§13.8.3](statements.md#1383-the-switch-statement)).
68106810
- `goto case` statements ([§13.10.4](statements.md#13104-the-goto-statement))
6811-
- Dimension lengths in an array creation expression ([§12.8.17.3](expressions.md#128173-array-creation-expressions)) that includes an initializer.
6811+
- Dimension lengths in an array creation expression ([§12.8.17.4](expressions.md#128174-array-creation-expressions)) that includes an initializer.
68126812
- Attributes ([§22](attributes.md#22-attributes))
68136813
- In a *constant_pattern* ([§11.2.3](patterns.md#1123-constant-pattern))
68146814

standard/grammar.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ post_decrement_expression
10411041
: primary_expression '--'
10421042
;
10431043
1044-
// Source: §12.8.17.2 Object creation expressions
1044+
// Source: §12.8.17.2.1 General
10451045
object_creation_expression
10461046
: 'new' type '(' argument_list? ')' object_or_collection_initializer?
10471047
| 'new' type object_or_collection_initializer
@@ -1052,7 +1052,7 @@ object_or_collection_initializer
10521052
| collection_initializer
10531053
;
10541054
1055-
// Source: §12.8.17.3 Object initializers
1055+
// Source: §12.8.17.2.2 Object initializers
10561056
object_initializer
10571057
: '{' member_initializer_list? '}'
10581058
| '{' member_initializer_list ',' '}'
@@ -1076,7 +1076,7 @@ initializer_value
10761076
| object_or_collection_initializer
10771077
;
10781078
1079-
// Source: §12.8.17.4 Collection initializers
1079+
// Source: §12.8.17.2.3 Collection initializers
10801080
collection_initializer
10811081
: '{' element_initializer_list '}'
10821082
| '{' element_initializer_list ',' '}'
@@ -1096,20 +1096,7 @@ expression_list
10961096
| expression_list ',' expression
10971097
;
10981098
1099-
// Source: §12.8.17.5 Array creation expressions
1100-
array_creation_expression
1101-
: 'new' non_array_type '[' expression_list ']' rank_specifier*
1102-
array_initializer?
1103-
| 'new' array_type array_initializer
1104-
| 'new' rank_specifier array_initializer
1105-
;
1106-
1107-
// Source: §12.8.17.6 Delegate creation expressions
1108-
delegate_creation_expression
1109-
: 'new' delegate_type '(' expression ')'
1110-
;
1111-
1112-
// Source: §12.8.17.7 Anonymous object creation expressions
1099+
// Source: §12.8.17.3 Anonymous object creation expressions
11131100
anonymous_object_creation_expression
11141101
: 'new' anonymous_object_initializer
11151102
;
@@ -1131,6 +1118,19 @@ member_declarator
11311118
| identifier '=' expression
11321119
;
11331120
1121+
// Source: §12.8.17.4 Array creation expressions
1122+
array_creation_expression
1123+
: 'new' non_array_type '[' expression_list ']' rank_specifier*
1124+
array_initializer?
1125+
| 'new' array_type array_initializer
1126+
| 'new' rank_specifier array_initializer
1127+
;
1128+
1129+
// Source: §12.8.17.5 Delegate creation expressions
1130+
delegate_creation_expression
1131+
: 'new' delegate_type '(' expression ')'
1132+
;
1133+
11341134
// Source: §12.8.18 The typeof operator
11351135
typeof_expression
11361136
: 'typeof' '(' type ')'

0 commit comments

Comments
 (0)