From 3fd826af859bfa59e0c1629e92326064d316c92f Mon Sep 17 00:00:00 2001 From: Rex Jaeschke Date: Fri, 15 Jan 2021 17:20:46 -0500 Subject: [PATCH 01/13] Update basic-concepts.md --- standard/basic-concepts.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/standard/basic-concepts.md b/standard/basic-concepts.md index 0f1224558..c6659df9b 100644 --- a/standard/basic-concepts.md +++ b/standard/basic-concepts.md @@ -663,8 +663,8 @@ type_name ; namespace_or_type_name - : identifier type_argument_list? - | namespace_or_type_name '.' identifier type_argument_list? + : Identifier type_argument_list? + | namespace_or_type_name '.' Identifier type_argument_list? | qualified_alias_member ; ``` @@ -720,8 +720,8 @@ A *namespace_or_type_name* is permitted to reference a static class ([§15.2.2.4 Every namespace declaration and type declaration has an ***unqualified name*** determined as follows: - For a namespace declaration, the unqualified name is the *qualified_identifier* specified in the declaration. -- For a type declaration with no *type_parameter_list*, the unqualified name is the *identifier* specified in the declaration. -- For a type declaration with K type parameters, the unqualified name is the *identifier* specified in the declaration, followed by the *generic_dimension_specifier* ([§12.7.12](expressions.md#12712-the-typeof-operator)) for K type parameters. +- For a type declaration with no *type_parameter_list*, the unqualified name is the *Identifier* specified in the declaration. +- For a type declaration with K type parameters, the unqualified name is the *Identifier* specified in the declaration, followed by the *generic_dimension_specifier* ([§12.7.12](expressions.md#12712-the-typeof-operator)) for K type parameters. ### 8.8.3 Fully qualified names From 1e2850532c150aa262a8c43f4fce2c384404af07 Mon Sep 17 00:00:00 2001 From: Rex Jaeschke Date: Fri, 15 Jan 2021 17:24:54 -0500 Subject: [PATCH 02/13] Update types.md --- standard/types.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard/types.md b/standard/types.md index 63e8db8f1..a131a3743 100644 --- a/standard/types.md +++ b/standard/types.md @@ -524,7 +524,7 @@ A type parameter is an identifier designating a value type or reference type tha ```ANTLR type_parameter - : identifier + : Identifier ; ``` From b6d55ee5e077d700ff2fb34feaca712f9085565c Mon Sep 17 00:00:00 2001 From: Rex Jaeschke Date: Fri, 15 Jan 2021 17:31:31 -0500 Subject: [PATCH 03/13] Update statements.md --- standard/statements.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/standard/statements.md b/standard/statements.md index fbc379462..b2f87920d 100644 --- a/standard/statements.md +++ b/standard/statements.md @@ -193,11 +193,11 @@ A *labeled_statement* permits a statement to be prefixed by a label. Labeled sta ```ANTLR labeled_statement - : identifier ':' statement + : Identifier ':' statement ; ``` -A labeled statement declares a label with the name given by the *identifier*. The scope of a label is the whole block in which the label is declared, including any nested blocks. It is a compile-time error for two labels with the same name to have overlapping scopes. +A labeled statement declares a label with the name given by the *Identifier*. The scope of a label is the whole block in which the label is declared, including any nested blocks. It is a compile-time error for two labels with the same name to have overlapping scopes. A label can be referenced from `goto` statements ([§13.10.4](statements.md#13104-the-goto-statement)) within the scope of the label. @@ -252,8 +252,8 @@ local_variable_declarators ; local_variable_declarator - : identifier - | identifier '=' local_variable_initializer + : Identifier + | Identifier '=' local_variable_initializer ; local_variable_initializer @@ -262,7 +262,7 @@ local_variable_initializer ; ``` -The *local_variable_type* of a *local_variable_declaration* either directly specifies the type of the variables introduced by the declaration, or indicates with the identifier `var` that the type should be inferred based on an initializer. The type is followed by a list of *local_variable_declarator*s, each of which introduces a new variable. A *local_variable_declarator* consists of an *identifier* that names the variable, optionally followed by an "`=`" token and a *local_variable_initializer* that gives the initial value of the variable. +The *local_variable_type* of a *local_variable_declaration* either directly specifies the type of the variables introduced by the declaration, or indicates with the identifier `var` that the type should be inferred based on an initializer. The type is followed by a list of *local_variable_declarator*s, each of which introduces a new variable. A *local_variable_declarator* consists of an *Identifier* that names the variable, optionally followed by an "`=`" token and a *local_variable_initializer* that gives the initial value of the variable. In the context of a local variable declaration, the identifier `var` acts as a contextual keyword ([§7.4.4](lexical-structure.md#744-keywords)).When the *local_variable_type* is specified as `var` and no type named `var` is in scope, the declaration is an ***implicitly typed local variable declaration***, whose type is inferred from the type of the associated initializer expression. Implicitly typed local variable declarations are subject to the following restrictions: @@ -338,11 +338,11 @@ constant_declarators ; constant_declarator - : identifier '=' constant_expression + : Identifier '=' constant_expression ; ``` -The *type* of a *local_constant_declaration* specifies the type of the constants introduced by the declaration. The type is followed by a list of *constant_declarator*s, each of which introduces a new constant. A *constant_declarator* consists of an *identifier* that names the constant, followed by an "`=`" token, followed by a *constant_expression* ([§12.20](expressions.md#1220-constant-expressions)) that gives the value of the constant. +The *type* of a *local_constant_declaration* specifies the type of the constants introduced by the declaration. The type is followed by a list of *constant_declarator*s, each of which introduces a new constant. A *constant_declarator* consists of an *Identifier* that names the constant, followed by an "`=`" token, followed by a *constant_expression* ([§12.20](expressions.md#1220-constant-expressions)) that gives the value of the constant. The *type* and *constant_expression* of a local constant declaration shall follow the same rules as those of a constant member declaration ([§15.4](classes.md#154-constants)). @@ -732,11 +732,11 @@ The `foreach` statement enumerates the elements of a collection, executing an em ```ANTLR foreach_statement - : 'foreach' '(' local_variable_type identifier 'in' expression ')' embedded_statement + : 'foreach' '(' local_variable_type Identifier 'in' expression ')' embedded_statement ; ``` -The *local_variable_type* and *identifier* of a `foreach` statement declare the ***iteration variable*** of the statement. If the `var` identifier is given as the *local_variable_type*, and no type named var is in scope, the iteration variable is said to be an ***implicitly typed iteration variable***, and its type is taken to be the element type of the `foreach` statement, as specified below. The iteration variable corresponds to a read-only local variable with a scope that extends over the embedded statement. During execution of a `foreach` statement, the iteration variable represents the collection element for which an iteration is currently being performed. A compile-time error occurs if the embedded statement attempts to modify the iteration variable (via assignment or the `++` and `--` operators) or pass the iteration variable as a `ref` or `out` parameter. +The *local_variable_type* and *Identifier* of a `foreach` statement declare the ***iteration variable*** of the statement. If the `var` identifier is given as the *local_variable_type*, and no type named var is in scope, the iteration variable is said to be an ***implicitly typed iteration variable***, and its type is taken to be the element type of the `foreach` statement, as specified below. The iteration variable corresponds to a read-only local variable with a scope that extends over the embedded statement. During execution of a `foreach` statement, the iteration variable represents the collection element for which an iteration is currently being performed. A compile-time error occurs if the embedded statement attempts to modify the iteration variable (via assignment or the `++` and `--` operators) or pass the iteration variable as a `ref` or `out` parameter. In the following, for brevity, `IEnumerable`, `IEnumerator`, `IEnumerable` and `IEnumerator` refer to the corresponding types in the namespaces `System.Collections` and `System.Collections.Generic`. @@ -973,13 +973,13 @@ The `goto` statement transfers control to a statement that is marked by a label. ```ANTLR goto_statement - : 'goto' identifier ';' + : 'goto' Identifier ';' | 'goto' 'case' constant_expression ';' | 'goto' 'default' ';' ; ``` -The target of a `goto` *identifier* statement is the labeled statement with the given label. If a label with the given name does not exist in the current function member, or if the `goto` statement is not within the scope of the label, a compile-time error occurs. +The target of a `goto` *Identifier* statement is the labeled statement with the given label. If a label with the given name does not exist in the current function member, or if the `goto` statement is not within the scope of the label, a compile-time error occurs. > *Note*: This rule permits the use of a `goto` statement to transfer control *out of* a nested scope, but not *into* a nested scope. In the example > ```csharp @@ -1093,7 +1093,7 @@ catch_clauses ; exception_specifier - : '(' type identifier? ')' + : '(' type Identifier? ')' ; ``` @@ -1105,7 +1105,7 @@ There are three possible forms of `try` statements: When a `catch` clause specifies a *type*, the type shall be `System.Exception` or a type that derives from `System.Exception`. When a `catch` clause specifies a *type_parameter* it shall be a type parameter type whose effective base class is or derives from `System.Exception`. -When a `catch` clause specifies both a *class_type* and an *identifier*, an ***exception variable*** of the given name and type is declared. The exception variable corresponds to a local variable with a scope that extends over the `catch` block. During execution of the `catch` block, the exception variable represents the exception currently being handled. For purposes of definite assignment checking, the exception variable is considered definitely assigned in its entire scope. +When a `catch` clause specifies both a *class_type* and an *Identifier*, an ***exception variable*** of the given name and type is declared. The exception variable corresponds to a local variable with a scope that extends over the `catch` block. During execution of the `catch` block, the exception variable represents the exception currently being handled. For purposes of definite assignment checking, the exception variable is considered definitely assigned in its entire scope. Unless a `catch` clause includes an exception variable name, it is impossible to access the exception object in the `catch` block. From bfae6b6aae1533a43ddcab41c7672083423eedfc Mon Sep 17 00:00:00 2001 From: Rex Jaeschke Date: Fri, 15 Jan 2021 17:34:10 -0500 Subject: [PATCH 04/13] Update namespaces.md --- standard/namespaces.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/standard/namespaces.md b/standard/namespaces.md index 7ba491b4f..12d06befe 100644 --- a/standard/namespaces.md +++ b/standard/namespaces.md @@ -45,7 +45,7 @@ namespace_declaration ; qualified_identifier - : identifier ('.' identifier)* + : Identifier ('.' Identifier)* ; namespace_body @@ -103,13 +103,13 @@ An *extern_alias_directive* introduces an identifier that serves as an alias for ```ANTLR extern_alias_directive - : 'extern' 'alias' identifier ';' + : 'extern' 'alias' Identifier ';' ; ``` The scope of an *extern_alias_directive* extends over the *using_directive*s, *global_attributes* and *namespace_member_declaration*s of its immediately containing *compilation_unit* or *namespace_body*. -Within a compilation unit or namespace body that contains an *extern_alias_directive*, the identifier introduced by the *extern_alias_directive* can be used to reference the aliased namespace. It is a compile-time error for the *identifier* to be the word `global`. +Within a compilation unit or namespace body that contains an *extern_alias_directive*, the identifier introduced by the *extern_alias_directive* can be used to reference the aliased namespace. It is a compile-time error for the *Identifier* to be the word `global`. Within C# source code, a type is declared a member of a single namespace. However, a namespace hierarchy referenced by an extern alias may contain types that are also members of other namespaces. For example, if `A` and `B` are extern aliases, the names `A::X`,`B::C.Y` and `global::D.Z` may, depending on the external specification supported by the particular compiler, all refer to the same type. @@ -148,7 +148,7 @@ A *using_alias_directive* introduces an identifier that serves as an alias for a ```ANTLR using_alias_directive - : 'using' identifier '=' namespace_or_type_name ';' + : 'using' Identifier '=' namespace_or_type_name ';' ; ``` @@ -226,7 +226,7 @@ An *extern_alias_directive* or *using_alias_directive* makes an alias available > ``` > *end example* -Each *extern_alias_directive* or *using_alias_directive* in a *compilation_unit* or *namespace_body* contributes a name to the ***alias declaration space*** ([§8.3](basic-concepts.md#83-declarations)) of the immediately enclosing *compilation_unit* or *namespace_body*. The *identifier* of the alias directive shall be unique within the corresponding alias declaration space. The alias identifier need not be unique within the global declaration space or the declaration space of the corresponding namespace. +Each *extern_alias_directive* or *using_alias_directive* in a *compilation_unit* or *namespace_body* contributes a name to the ***alias declaration space*** ([§8.3](basic-concepts.md#83-declarations)) of the immediately enclosing *compilation_unit* or *namespace_body*. The *Identifier* of the alias directive shall be unique within the corresponding alias declaration space. The alias identifier need not be unique within the global declaration space or the declaration space of the corresponding namespace. > *Example*: > ```csharp @@ -499,7 +499,7 @@ A *qualified_alias_member* provides explicit access to the global namespace and ```ANTLR qualified_alias_member - : identifier '::' identifier type_argument_list? + : Identifier '::' Identifier type_argument_list? ; ``` From 359f5422f5b49acf018e52b89b8a99e83bed3cfb Mon Sep 17 00:00:00 2001 From: Rex Jaeschke Date: Fri, 15 Jan 2021 17:37:03 -0500 Subject: [PATCH 05/13] Update attributes.md --- standard/attributes.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/standard/attributes.md b/standard/attributes.md index 835ae7732..4430f4b16 100644 --- a/standard/attributes.md +++ b/standard/attributes.md @@ -170,7 +170,7 @@ global_attribute_target_specifier ; global_attribute_target - : identifier + : Identifier ; attributes @@ -187,8 +187,8 @@ attribute_target_specifier ; attribute_target - : identifier - | keyword + : Identifier + | Keyword ; attribute_list @@ -222,7 +222,7 @@ named_argument_list ; named_argument - : identifier '=' attribute_argument_expression + : Identifier '=' attribute_argument_expression ; attribute_argument_expression @@ -230,7 +230,7 @@ attribute_argument_expression ; ``` -For the production *global_attribute_target*, and in the text below, *identifier* shall have a spelling equal to `assembly` or `module`, where equality is that defined in [§7.4.3](lexical-structure.md#743-identifiers). For the production *attribute_target*, and in the text below, *identifier* shall have a spelling that is not equal to `assembly` or `module`, using the same definition of equality as above. +For the production *global_attribute_target*, and in the text below, *Identifier* shall have a spelling equal to `assembly` or `module`, where equality is that defined in [§7.4.3](lexical-structure.md#743-identifiers). For the production *attribute_target*, and in the text below, *Identifier* shall have a spelling that is not equal to `assembly` or `module`, using the same definition of equality as above. An attribute consists of an *attribute_name* and an optional list of positional and named arguments. The positional arguments (if any) precede the named arguments. A positional argument consists of an *attribute_argument_expression*; a named argument consists of a name, followed by an equal sign, followed by an *attribute_argument_expression*, which, together, are constrained by the same rules as simple assignment. The order of named arguments is not significant. @@ -303,7 +303,7 @@ By convention, attribute classes are named with a suffix of `Attribute`. An *att * The characters `Attribute` are appended to the right-most identifier in the *attribute_name* and the resulting string of tokens is resolved as a *type_name* ([§8.8](basic-concepts.md#88-namespace-and-type-names)) except any errors are suppressed. If this resolution is successful and results in a type derived from `System.Attribute` then the type is the result of this step. If exactly one of the two steps above results in a type derived from `System.Attribute`, then that type is the result of the *attribute-name*. Otherwise a compile-time error occurs. -*Example*: If an attribute class is found both with and without this suffix, an ambiguity is present, and a compile-time error results. If the *attribute_name* is spelled such that its right-most *identifier* is a verbatim identifier ([§7.4.3](lexical-structure.md#743-identifiers)), then only an attribute without a suffix is matched, thus enabling such an ambiguity to be resolved. The example +*Example*: If an attribute class is found both with and without this suffix, an ambiguity is present, and a compile-time error results. If the *attribute_name* is spelled such that its right-most *Identifier* is a verbatim identifier ([§7.4.3](lexical-structure.md#743-identifiers)), then only an attribute without a suffix is matched, thus enabling such an ambiguity to be resolved. The example > ```csharp > using System; > [AttributeUsage(AttributeTargets.All)] @@ -434,7 +434,7 @@ The compilation of an *attribute* with attribute class `T`, *positional_argumen * Follow the compile-time processing steps for compiling an *object_creation_expression* of the form new `T(P)`. These steps either result in a compile-time error, or determine an instance constructor `C` on `T` that can be invoked at run-time. * If `C` does not have public accessibility, then a compile-time error occurs. * For each *named_argument* `Arg` in `N`: - * Let `Name` be the *identifier* of the *named_argument* `Arg`. + * Let `Name` be the *Identifier* of the *named_argument* `Arg`. * `Name` shall identify a non-static read-write public field or property on `T`. If `T` has no such field or property, then a compile-time error occurs. * If any of the values within *positional_argument_list* `P` or one of the values within *named_argument_list* `N` is of type `System.String` and the value is not well-formed as defined by the Unicode Standard, it is implementation-defined whether the value compiled is equal to the run-time value retrieved ([§22.4.3](attributes.md#2243-run-time-retrieval-of-an-attribute-instance)). > *Note*: As an example, a string which contains a high surrogate UTF-16 code unit which isn't immediately followed by a low surrogate code unit is not well-formed. *end note* @@ -446,7 +446,7 @@ The attribute instance represented by `T`, `C`, `P`, and `N`, and associated wi - Follow the run-time processing steps for executing an *object_creation_expression* of the form `new T(P)`, using the instance constructor `C` and values as determined at compile-time. These steps either result in an exception, or produce an instance `O` of `T`. - For each *named_argument* `Arg` in `N`, in order: - - Let `Name` be the *identifier* of the *named_argument* `Arg`. If `Name` does not identify a non-static public read-write field or property on `O`, then an exception is thrown. + - Let `Name` be the *Identifier* of the *named_argument* `Arg`. If `Name` does not identify a non-static public read-write field or property on `O`, then an exception is thrown. - Let `Value` be the result of evaluating the *attribute_argument_expression* of `Arg`. - If `Name` identifies a field on `O`, then set this field to `Value`. - Otherwise, Name identifies a property on `O`. Set this property to Value. From 04e2e5cf3607163e982599175de51c7a4a7cbc30 Mon Sep 17 00:00:00 2001 From: Rex Jaeschke Date: Fri, 15 Jan 2021 17:38:10 -0500 Subject: [PATCH 06/13] Update delegates.md --- standard/delegates.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/standard/delegates.md b/standard/delegates.md index e2aa44902..46d7e3521 100644 --- a/standard/delegates.md +++ b/standard/delegates.md @@ -12,7 +12,7 @@ A *delegate_declaration* is a *type_declaration* ([§14.7](namespaces.md#147-typ ```ANTLR delegate_declaration - : attributes? delegate_modifier* 'delegate' return_type identifier variant_type_parameter_list? '(' formal_parameter_list? ')' type_parameter_constraints_clause* ';' + : attributes? delegate_modifier* 'delegate' return_type Identifier variant_type_parameter_list? '(' formal_parameter_list? ')' type_parameter_constraints_clause* ';' ; delegate_modifier @@ -34,7 +34,7 @@ The `new` modifier is only permitted on delegates declared within another type, The `public`, `protected`, `internal`, and `private` modifiers control the accessibility of the delegate type. Depending on the context in which the delegate declaration occurs, some of these modifiers might not be permitted ([§8.5.2](basic-concepts.md#852-declared-accessibility)). -The delegate's type name is *identifier*. +The delegate's type name is *Identifier*. The optional *formal_parameter_list* specifies the parameters of the delegate, and *return_type* indicates the return type of the delegate. From e75cf0c85f14e5d3ba05c51f04de1944c05dd39c Mon Sep 17 00:00:00 2001 From: Rex Jaeschke Date: Fri, 15 Jan 2021 17:38:59 -0500 Subject: [PATCH 07/13] Update enums.md --- standard/enums.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/standard/enums.md b/standard/enums.md index 8ec26bdce..1db73476e 100644 --- a/standard/enums.md +++ b/standard/enums.md @@ -22,7 +22,7 @@ An enum declaration declares a new enum type. An enum declaration begins with th ```ANTLR enum_declaration - : attributes? enum_modifier* 'enum' identifier enum_base? enum_body ';'? + : attributes? enum_modifier* 'enum' Identifier enum_base? enum_body ';'? ; enum_base @@ -87,7 +87,7 @@ enum_member_declarations ```ANTLR enum_member_declaration - : attributes? identifier ('=' constant_expression)? + : attributes? Identifier ('=' constant_expression)? ; ``` From 84b22eb87ced8998ba0922c16311433244940502 Mon Sep 17 00:00:00 2001 From: Rex Jaeschke Date: Fri, 15 Jan 2021 17:40:49 -0500 Subject: [PATCH 08/13] Update interfaces.md --- standard/interfaces.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/standard/interfaces.md b/standard/interfaces.md index 2d5a79686..d9dcd997d 100644 --- a/standard/interfaces.md +++ b/standard/interfaces.md @@ -14,11 +14,11 @@ An *interface_declaration* is a *type_declaration* ([§14.7](namespaces.md#147-t ```ANTLR interface_declaration - : attributes? interface_modifier* 'partial'? 'interface' identifier variant_type_parameter_list? interface_base? type_parameter_constraints_clause* interface_body ';'? + : attributes? interface_modifier* 'partial'? 'interface' Identifier variant_type_parameter_list? interface_base? type_parameter_constraints_clause* interface_body ';'? ; ``` -An *interface_declaration* consists of an optional set of *attributes* ([§22](attributes.md#22-attributes)), followed by an optional set of *interface_modifier*s ([§18.2.2](interfaces.md#1822-interface-modifiers)), followed by an optional partial modifier ([§15.2.7](classes.md#1527-partial-declarations)), followed by the keyword interface and an *identifier* that names the interface, followed by an optional *variant_type_parameter_list* specification ([§18.2.3](interfaces.md#1823-variant-type-parameter-lists)), followed by an optional *interface_base* specification ([§18.2.4](interfaces.md#1824-base-interfaces)), followed by an optional *type_parameter_constraints_clause*s specification ([§15.2.5](classes.md#1525-type-parameter-constraints)), followed by an *interface_body* ([§18.3](interfaces.md#183-interface-body)), optionally followed by a semicolon. +An *interface_declaration* consists of an optional set of *attributes* ([§22](attributes.md#22-attributes)), followed by an optional set of *interface_modifier*s ([§18.2.2](interfaces.md#1822-interface-modifiers)), followed by an optional partial modifier ([§15.2.7](classes.md#1527-partial-declarations)), followed by the keyword interface and an *Identifier* that names the interface, followed by an optional *variant_type_parameter_list* specification ([§18.2.3](interfaces.md#1823-variant-type-parameter-lists)), followed by an optional *interface_base* specification ([§18.2.4](interfaces.md#1824-base-interfaces)), followed by an optional *type_parameter_constraints_clause*s specification ([§15.2.5](classes.md#1525-type-parameter-constraints)), followed by an *interface_body* ([§18.3](interfaces.md#183-interface-body)), optionally followed by a semicolon. An interface declaration shall not supply a *type_parameter_constraints_clause*s unless it also supplies a *type_parameter_list*. @@ -226,11 +226,11 @@ Interface methods are declared using *interface_method_declaration*s: ```ANTLR interface_method_declaration - : attributes? 'new'? return_type identifier type_parameter_list? '(' formal_parameter_list? ')' type_parameter_constraints_clause* ';' + : attributes? 'new'? return_type Identifier type_parameter_list? '(' formal_parameter_list? ')' type_parameter_constraints_clause* ';' ; ``` -The *attributes*, *return_type*, *identifier*, and *formal_parameter_list* of an interface method declaration have the same meaning as those of a method declaration in a class ([§15.6](classes.md#156-methods)). An interface method declaration is not permitted to specify a method body, and the declaration therefore always ends with a semicolon. An *interface_method_declaration* shall not have *type_parameter_constraints_clause*s unless it also has a *type_parameter_list*. +The *attributes*, *return_type*, *Identifier*, and *formal_parameter_list* of an interface method declaration have the same meaning as those of a method declaration in a class ([§15.6](classes.md#156-methods)). An interface method declaration is not permitted to specify a method body, and the declaration therefore always ends with a semicolon. An *interface_method_declaration* shall not have *type_parameter_constraints_clause*s unless it also has a *type_parameter_list*. Each formal parameter type of an interface method shall be input-safe ([§18.2.3.2](interfaces.md#18232-variance-safety)), and the return type shall be either `void` or output-safe. In addition, any `out` or `ref` formal parameter types shall also be output-safe. @@ -264,7 +264,7 @@ Interface properties are declared using *interface_property_declaration*s: ```ANTLR interface_property_declaration - : attributes? 'new'? type identifier '{' interface_accessors '}' + : attributes? 'new'? type Identifier '{' interface_accessors '}' ; ``` @@ -277,7 +277,7 @@ interface_accessors ; ``` -The *attributes*, *type*, and *identifier* of an interface property declaration have the same meaning as those of a property declaration in a class ([§15.7](classes.md#157-properties)). +The *attributes*, *type*, and *Identifier* of an interface property declaration have the same meaning as those of a property declaration in a class ([§15.7](classes.md#157-properties)). The accessors of an interface property declaration correspond to the accessors of a class property declaration ([§15.7.3](classes.md#1573-accessors)), except that the accessor body shall always be a semicolon. Thus, the accessors simply indicate whether the property is read-write, read-only, or write-only. @@ -289,11 +289,11 @@ Interface events are declared using *interface_event_declaration*s: ```ANTLR interface_event_declaration - : attributes? 'new'? 'event' type identifier ';' + : attributes? 'new'? 'event' type Identifier ';' ; ``` -The *attributes*, *type*, and *identifier* of an interface event declaration have the same meaning as those of an event declaration in a class ([§15.8](classes.md#158-events)). +The *attributes*, *type*, and *Identifier* of an interface event declaration have the same meaning as those of an event declaration in a class ([§15.8](classes.md#158-events)). The type of an interface event shall be input-safe. From 7604b508008ee4ad721dca151a9129092d32d57e Mon Sep 17 00:00:00 2001 From: Rex Jaeschke Date: Fri, 15 Jan 2021 17:41:41 -0500 Subject: [PATCH 09/13] Update structs.md --- standard/structs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/standard/structs.md b/standard/structs.md index c23e8fd38..7dec239c6 100644 --- a/standard/structs.md +++ b/standard/structs.md @@ -16,12 +16,12 @@ A *struct_declaration* is a *type_declaration* ([§14.7](namespaces.md#147-type- ```ANTLR struct_declaration - : attributes? struct_modifier* 'partial'? 'struct' identifier type_parameter_list? + : attributes? struct_modifier* 'partial'? 'struct' Identifier type_parameter_list? struct_interfaces? type_parameter_constraints_clause* struct_body ';'? ; ``` -A *struct_declaration* consists of an optional set of *attributes* ([§22](attributes.md#22-attributes)), followed by an optional set of *struct_modifier*s ([§16.2.2](structs.md#1622-struct-modifiers)), followed by an optional partial modifier ([§15.2.7](classes.md#1527-partial-declarations)), followed by the keyword `struct` and an *identifier* that names the struct, followed by an optional *type_parameter_list* specification ([§15.2.3](classes.md#1523-type-parameters)), followed by an optional *struct_interfaces* specification ([§16.2.4](structs.md#1624-struct-interfaces)), followed by an optional *type_parameter_constraints-clauses* specification ([§15.2.5](classes.md#1525-type-parameter-constraints)), followed by a *struct_body* ([§16.2.5](structs.md#1625-struct-body)), optionally followed by a semicolon. +A *struct_declaration* consists of an optional set of *attributes* ([§22](attributes.md#22-attributes)), followed by an optional set of *struct_modifier*s ([§16.2.2](structs.md#1622-struct-modifiers)), followed by an optional partial modifier ([§15.2.7](classes.md#1527-partial-declarations)), followed by the keyword `struct` and an *Identifier* that names the struct, followed by an optional *type_parameter_list* specification ([§15.2.3](classes.md#1523-type-parameters)), followed by an optional *struct_interfaces* specification ([§16.2.4](structs.md#1624-struct-interfaces)), followed by an optional *type_parameter_constraints-clauses* specification ([§15.2.5](classes.md#1525-type-parameter-constraints)), followed by a *struct_body* ([§16.2.5](structs.md#1625-struct-body)), optionally followed by a semicolon. A struct declaration shall not supply a *type_parameter_constraints_clauses* unless it also supplies a *type_parameter_list*. From 13e774281e72615bb8d4ec9731af5728178cd7dc Mon Sep 17 00:00:00 2001 From: Rex Jaeschke Date: Sat, 16 Jan 2021 09:35:21 -0500 Subject: [PATCH 10/13] Update expressions.md --- standard/expressions.md | 70 ++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/standard/expressions.md b/standard/expressions.md index ce4b8697e..9b3b4a219 100644 --- a/standard/expressions.md +++ b/standard/expressions.md @@ -538,7 +538,7 @@ argument ; argument_name - : identifier ':' + : Identifier ':' ; argument_value @@ -1104,7 +1104,7 @@ primary_expression ; primary_no_array_creation_expression - : literal + : Literal | simple_name | parenthesized_expression | member_access @@ -1150,7 +1150,7 @@ A *simple_name* consists of an identifier, optionally followed by a type argumen ```ANTLR simple_name - : identifier type_argument_list? + : Identifier type_argument_list? ; ``` @@ -1247,13 +1247,13 @@ A *parenthesized_expression* is evaluated by evaluating the *expression* within #### 12.7.5.1 General -A *member_access* consists of a *primary_expression*, a *predefined_type*, or a *qualified_alias_member*, followed by a "`.`" token, followed by an *identifier*, optionally followed by a *type_argument_list*. +A *member_access* consists of a *primary_expression*, a *predefined_type*, or a *qualified_alias_member*, followed by a "`.`" token, followed by an *Identifier*, optionally followed by a *type_argument_list*. ```ANTLR member_access - : primary_expression '.' identifier type_argument_list? - | predefined_type '.' identifier type_argument_list? - | qualified_alias_member '.' identifier type_argument_list? + : primary_expression '.' Identifier type_argument_list? + | predefined_type '.' Identifier type_argument_list? + | qualified_alias_member '.' Identifier type_argument_list? ; predefined_type @@ -1389,10 +1389,10 @@ Once a method has been selected and validated at binding-time by the above steps In a method invocation ([§12.6.6.2](expressions.md#12662-invocations-on-boxed-instances)) of one of the forms ```csharp -«expr» . «identifier» ( ) -«expr» . «identifier» ( «args» ) -«expr» . «identifier» < «typeargs» > ( ) -«expr» . «identifier» < «typeargs» > ( «args» ) +«expr» . «Identifier» ( ) +«expr» . «Identifier» ( «args» ) +«expr» . «Identifier» < «typeargs» > ( ) +«expr» . «Identifier» < «typeargs» > ( «args» ) ``` if the normal processing of the invocation finds no applicable methods, an attempt is made to process the construct as an extension method invocation. If «expr» or any of the «args» has compile-time type `dynamic`, extension methods will not apply. @@ -1400,16 +1400,16 @@ if the normal processing of the invocation finds no applicable methods, an attem The objective is to find the best *type_name* `C`, so that the corresponding static method invocation can take place: ```csharp -C . «identifier» ( «expr» ) -C . «identifier» ( «expr» , «args» ) -C . «identifier» < «typeargs» > ( «expr» ) -C . «identifier» < «typeargs» > ( «expr» , «args» ) +C . «Identifier» ( «expr» ) +C . «Identifier» ( «expr» , «args» ) +C . «Identifier» < «typeargs» > ( «expr» ) +C . «Identifier» < «typeargs» > ( «expr» , «args» ) ``` An extension method `Cᵢ.Mₑ` is ***eligible*** if: - `Cᵢ` is a non-generic, non-nested class -- The name of `Mₑ` is *identifier* +- The name of `Mₑ` is *Identifier* - `Mₑ` is accessible and applicable when applied to the arguments as a static method as shown above - An implicit identity, reference or boxing conversion exists from *expr* to the type of the first parameter of `Mₑ`. @@ -1730,7 +1730,7 @@ member_initializer_list ; member_initializer - : identifier '=' initializer_value + : Identifier '=' initializer_value ; initializer_value @@ -2070,7 +2070,7 @@ member_declarator : simple_name | member_access | base_access - | identifier '=' expression + | Identifier '=' expression ; ``` @@ -2120,11 +2120,11 @@ The `Equals` and `GetHashcode` methods on anonymous types override the methods i A member declarator can be abbreviated to a simple name ([§12.7.3](expressions.md#1273-simple-names)), a member access ([§12.7.5](expressions.md#1275-member-access)) or a base access ([§12.7.9](expressions.md#1279-base-access)). This is called a ***projection initializer*** and is shorthand for a declaration of and assignment to a property with the same name. Specifically, member declarators of the forms -`«identifier»` and `«expr» . «identifier»` +`«Identifier»` and `«expr» . «Identifier»` are precisely equivalent to the following, respectively: -`«identifer» = «identifier»` and `«identifier» = «expr» . «identifier»` +`«identifer» = «Identifier»` and `«Identifier» = «expr» . «Identifier»` 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. @@ -2140,9 +2140,9 @@ typeof_expression ; unbound_type_name - : identifier generic_dimension_specifier? - | identifier '::' identifier generic_dimension_specifier? - | unbound_type_name '.' identifier generic_dimension_specifier? + : Identifier generic_dimension_specifier? + | Identifier '::' Identifier generic_dimension_specifier? + | unbound_type_name '.' Identifier generic_dimension_specifier? ; generic_dimension_specifier @@ -2221,11 +2221,11 @@ The `typeof` operator can be used on a type parameter. The result is the `System ### 12.7.13 The sizeof operator -The `sizeof` operator returns the number of 8-bit bytes occupied by a variable of a given type. The type specified as an operand to sizeof shall be an *unmanaged_type* ([§23.3](unsafe-code.md#233-pointer-types)). +The `sizeof` operator returns the number of 8-bit bytes occupied by a variable of a given type. The type specified as an operand to sizeof shall be an *Unmanaged_Type* ([§23.3](unsafe-code.md#233-pointer-types)). ```ANTLR sizeof_expression - : 'sizeof' '(' unmanaged_type ')' + : 'sizeof' '(' Unmanaged_Type ')' ; ``` @@ -3321,7 +3321,7 @@ The `<<` and `>>` operators are used to perform bit-shifting operations. shift_expression : additive_expression | shift_expression '<<' additive_expression - | shift_expression right_shift additive_expression + | shift_expression Right_Shift additive_expression ; ``` @@ -4028,7 +4028,7 @@ explicit_anonymous_function_parameter_list ; explicit_anonymous_function_parameter - : anonymous_function_parameter_modifier? type identifier + : anonymous_function_parameter_modifier? type Identifier ; anonymous_function_parameter_modifier @@ -4046,7 +4046,7 @@ implicit_anonymous_function_parameter_list ; implicit_anonymous_function_parameter - : identifier + : Identifier ; anonymous_function_body @@ -4511,7 +4511,7 @@ query_expression ; from_clause - : 'from' type? identifier 'in' expression + : 'from' type? Identifier 'in' expression ; query_body @@ -4533,7 +4533,7 @@ query_body_clause ; let_clause - : 'let' identifier '=' expression + : 'let' Identifier '=' expression ; where_clause @@ -4541,11 +4541,11 @@ where_clause ; join_clause - : 'join' type? identifier 'in' expression 'on' expression 'equals' expression + : 'join' type? Identifier 'in' expression 'on' expression 'equals' expression ; join_into_clause - : 'join' type? identifier 'in' expression 'on' expression 'equals' expression 'into' identifier + : 'join' type? Identifier 'in' expression 'on' expression 'equals' expression 'into' Identifier ; orderby_clause @@ -4579,7 +4579,7 @@ group_clause ; query_continuation - : 'into' identifier query_body + : 'into' Identifier query_body ; ``` @@ -4590,7 +4590,7 @@ filter that excludes items from the result. Each `join` clause compares specifie Query expressions use a number of contextual keywords ([§7.4.4](lexical-structure.md#744-keywords)): `ascending`, `by`, `descending`, `equals`, `from`, `group`, `into`, `join`, `let`, `on`, `orderly`, `select` and `where`. -To avoid ambiguities that could arise from the use of these identifiers both as keywords and simple names these identifiers are considered keywords anywhere within a query expression, unless they are prefixed with "`@`" ([§7.4.4](lexical-structure.md#744-keywords)) in which case they are considered identifiers. For this purpose, a query expression is any expression that starts with "`from` *identifier*" followed by any token except "`;`", "`=`" or "`,`". +To avoid ambiguities that could arise from the use of these identifiers both as keywords and simple names these identifiers are considered keywords anywhere within a query expression, unless they are prefixed with "`@`" ([§7.4.4](lexical-structure.md#744-keywords)) in which case they are considered identifiers. For this purpose, a query expression is any expression that starts with "`from` *Identifier*" followed by any token except "`;`", "`=`" or "`,`". ### 12.17.3 Query expression translation @@ -5187,7 +5187,7 @@ assignment assignment_operator : '=' | '+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' | '<<=' - | right_shift_assignment + | Right_Shift_Assignment ; ``` From 949f9a3922c8c925d8ffd6e7e9a4f416ae7243e1 Mon Sep 17 00:00:00 2001 From: Rex Jaeschke Date: Sat, 16 Jan 2021 09:39:36 -0500 Subject: [PATCH 11/13] Update classes.md --- standard/classes.md | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/standard/classes.md b/standard/classes.md index 1eca9301f..4d347afe8 100644 --- a/standard/classes.md +++ b/standard/classes.md @@ -12,12 +12,12 @@ A *class_declaration* is a *type_declaration* ([§14.7](namespaces.md#147-type-d ```ANTLR class_declaration - : attributes? class_modifier* 'partial'? 'class' identifier type_parameter_list? + : attributes? class_modifier* 'partial'? 'class' Identifier type_parameter_list? class_base? type_parameter_constraints_clause* class_body ';'? ; ``` -A *class_declaration* consists of an optional set of *attributes* ([§22](attributes.md#22-attributes)), followed by an optional set of *class_modifier*s ([§15.2.2](classes.md#1522-class-modifiers)), followed by an optional `partial` modifier ([§15.2.7](classes.md#1527-partial-declarations)), followed by the keyword `class` and an *identifier* that names the class, followed by an optional *type_parameter_list* ([§15.2.3](classes.md#1523-type-parameters)), followed by an optional *class_base* specification ([§15.2.4](classes.md#1524-class-base-specification)), followed by an optional set of *type_parameter_constraints_clause*s ([§15.2.5](classes.md#1525-type-parameter-constraints)), followed by a *class_body* ([§15.2.6](classes.md#1526-class-body)), optionally followed by a semicolon. +A *class_declaration* consists of an optional set of *attributes* ([§22](attributes.md#22-attributes)), followed by an optional set of *class_modifier*s ([§15.2.2](classes.md#1522-class-modifiers)), followed by an optional `partial` modifier ([§15.2.7](classes.md#1527-partial-declarations)), followed by the keyword `class` and an *Identifier* that names the class, followed by an optional *type_parameter_list* ([§15.2.3](classes.md#1523-type-parameters)), followed by an optional *class_base* specification ([§15.2.4](classes.md#1524-class-base-specification)), followed by an optional set of *type_parameter_constraints_clause*s ([§15.2.5](classes.md#1525-type-parameter-constraints)), followed by a *class_body* ([§15.2.6](classes.md#1526-class-body)), optionally followed by a semicolon. A class declaration shall not supply a *type_parameter_constraints_clause*s unless it also supplies a *type_parameter_list*. @@ -1183,7 +1183,7 @@ constant_modifier A *constant_declaration* may include a set of *attributes* ([§22](attributes.md#22-attributes)), a `new` modifier ([§15.3.5](classes.md#1535-the-new-modifier)), and a valid combination of the four access modifiers ([§15.3.6](classes.md#1536-access-modifiers)). The attributes and modifiers apply to all of the members declared by the *constant_declaration*. Even though constants are considered static members, a *constant_declaration* neither requires nor allows a `static` modifier. It is an error for the same modifier to appear multiple times in a constant declaration. -The *type* of a *constant_declaration* specifies the type of the members introduced by the declaration. The type is followed by a list of *constant_declarator*s ([§13.6.3](statements.md#1363-local-constant-declarations)), each of which introduces a new member. A *constant_declarator* consists of an *identifier* that names the member, followed by an "`=`" token, followed by a *constant_expression* ([§12.20](expressions.md#1220-constant-expressions)) that gives the value of the member. +The *type* of a *constant_declaration* specifies the type of the members introduced by the declaration. The type is followed by a list of *constant_declarator*s ([§13.6.3](statements.md#1363-local-constant-declarations)), each of which introduces a new member. A *constant_declarator* consists of an *Identifier* that names the member, followed by an "`=`" token, followed by a *constant_expression* ([§12.20](expressions.md#1220-constant-expressions)) that gives the value of the member. The *type* specified in a constant declaration shall be `sbyte`, `byte`, `short`, `ushort`, `int`, `uint`, `long`, `ulong`, `char`, `float`, `double`, `decimal`, `bool`, `string`, an *enum_type*, or a *reference_type*. Each *constant_expression* shall yield a value of the target type or of a type that can be converted to the target type by an implicit conversion ([§11.2](conversions.md#112-implicit-conversions)). @@ -1268,13 +1268,13 @@ variable_declarators ; variable_declarator - : identifier ('=' variable_initializer)? + : Identifier ('=' variable_initializer)? ; ``` A *field_declaration* may include a set of *attributes* ([§22](attributes.md#22-attributes)), a `new` modifier ([§15.3.5](classes.md#1535-the-new-modifier)), a valid combination of the four access modifiers ([§15.3.6](classes.md#1536-access-modifiers)), and a `static` modifier ([§15.5.2](classes.md#1552-static-and-instance-fields)). In addition, a *field_declaration* may include a `readonly` modifier ([§15.5.3](classes.md#1553-readonly-fields)) or a `volatile` modifier ([§15.5.4](classes.md#1554-volatile-fields)), but not both. The attributes and modifiers apply to all of the members declared by the *field_declaration*. It is an error for the same modifier to appear multiple times in a *field_declaration*. -The *type* of a *field_declaration* specifies the type of the members introduced by the declaration. The type is followed by a list of *variable_declarator*s, each of which introduces a new member. A *variable_declarator* consists of an *identifier* that names that member, optionally followed by an "`=`" token and a *variable_initializer* ([§15.5.6](classes.md#1556-variable-initializers)) that gives the initial value of that member. +The *type* of a *field_declaration* specifies the type of the members introduced by the declaration. The type is followed by a list of *variable_declarator*s, each of which introduces a new member. A *variable_declarator* consists of an *Identifier* that names that member, optionally followed by an "`=`" token and a *variable_initializer* ([§15.5.6](classes.md#1556-variable-initializers)) that gives the initial value of that member. The *type* of a field shall be at least as accessible as the field itself ([§8.5.5](basic-concepts.md#855-accessibility-constraints)). @@ -1606,8 +1606,8 @@ return_type ; member_name - : identifier - | interface_type '.' identifier + : Identifier + | interface_type '.' Identifier ; method_body @@ -1629,7 +1629,7 @@ A declaration has a valid combination of modifiers if all of the following are t The *return_type* of a method declaration specifies the type of the value computed and returned by the method. The *return_type* is `void` if the method does not return a value. If the declaration includes the `partial` modifier, then the return type shall be `void` ([§15.6.9](classes.md#1569-partial-methods)). If the declaration includes the `async` modifier then the return type shall be `void` or a *task type* ([§15.15.1](classes.md#15151-general)). -A generic method is a method whose declaration includes a *type_parameter_list*. This specifies the type parameters for the method. The optional *type_parameter_constraints_clause*s specify the constraints for the type parameters. A *method_declaration* shall not have *type_parameter_constraints_clauses* unless it also has a *type_parameter_list*. A *method_declaration* for an explicit interface member implementation shall not have any *type_parameter_constraints_clause*s. A generic *method_declaration* for an explicit interface member implementation inherits any constraints from the constraints on the interface method. Similarly, a method declaration with the `override` modifier shall not have any *type_parameter_constraints_clause*s and the constraints of the method's type parameters are inherited from the virtual method being overridden.The *member_name* specifies the name of the method. Unless the method is an explicit interface member implementation ([§18.6.2](interfaces.md#1862-explicit-interface-member-implementations)), the *member_name* is simply an *identifier*. For an explicit interface member implementation, the *member_name* consists of an *interface_type* followed by a "`.`" and an *identifier*. In this case, the declaration shall include no modifiers other than (possibly) `extern` or `async`. +A generic method is a method whose declaration includes a *type_parameter_list*. This specifies the type parameters for the method. The optional *type_parameter_constraints_clause*s specify the constraints for the type parameters. A *method_declaration* shall not have *type_parameter_constraints_clauses* unless it also has a *type_parameter_list*. A *method_declaration* for an explicit interface member implementation shall not have any *type_parameter_constraints_clause*s. A generic *method_declaration* for an explicit interface member implementation inherits any constraints from the constraints on the interface method. Similarly, a method declaration with the `override` modifier shall not have any *type_parameter_constraints_clause*s and the constraints of the method's type parameters are inherited from the virtual method being overridden.The *member_name* specifies the name of the method. Unless the method is an explicit interface member implementation ([§18.6.2](interfaces.md#1862-explicit-interface-member-implementations)), the *member_name* is simply an *Identifier*. For an explicit interface member implementation, the *member_name* consists of an *interface_type* followed by a "`.`" and an *Identifier*. In this case, the declaration shall include no modifiers other than (possibly) `extern` or `async`. The optional *formal_parameter_list* specifies the parameters of the method ([§15.6.2](classes.md#1562-method-parameters)). @@ -1665,7 +1665,7 @@ fixed_parameters ; fixed_parameter - : attributes? parameter_modifier? type identifier default_argument? + : attributes? parameter_modifier? type Identifier default_argument? ; default_argument @@ -1683,13 +1683,13 @@ parameter_mode_modifier ; parameter_array - : attributes? 'params' array_type identifier + : attributes? 'params' array_type Identifier ; ``` The formal parameter list consists of one or more comma-separated parameters of which only the last may be a *parameter_array*. -A *fixed_parameter* consists of an optional set of *attributes* ([§22](attributes.md#22-attributes)); an optional `ref`, `out`, or `this` modifier; a *type*; an *identifier*; and an optional *default-argument*. Each *fixed_parameter* declares a parameter of the given type with the given name. The `this` modifier designates the method as an extension method and is only allowed on the first parameter of a static method in a non-generic, non-nested static class. Extension methods are further described in [§15.6.10](classes.md#15610-extension-methods). A *fixed_parameter* with a *default_argument* is known as an ***optional parameter***, whereas a *fixed_parameter* without a *default_argument* is a ***required parameter***. A required parameter may not appear after an optional parameter in a *formal_parameter_list*. +A *fixed_parameter* consists of an optional set of *attributes* ([§22](attributes.md#22-attributes)); an optional `ref`, `out`, or `this` modifier; a *type*; an *Identifier*; and an optional *default-argument*. Each *fixed_parameter* declares a parameter of the given type with the given name. The `this` modifier designates the method as an extension method and is only allowed on the first parameter of a static method in a non-generic, non-nested static class. Extension methods are further described in [§15.6.10](classes.md#15610-extension-methods). A *fixed_parameter* with a *default_argument* is known as an ***optional parameter***, whereas a *fixed_parameter* without a *default_argument* is a ***required parameter***. A required parameter may not appear after an optional parameter in a *formal_parameter_list*. A parameter with a `ref`, `out` or `this` modifier cannot have a *default_argument*. The *expression* in a *default_argument* shall be one of the following: @@ -1701,7 +1701,7 @@ The *expression* shall be implicitly convertible by an identity or nullable conv If optional parameters occur in an implementing partial method declaration ([§15.6.9](classes.md#1569-partial-methods)), an explicit interface member implementation ([§18.6.2](interfaces.md#1862-explicit-interface-member-implementations)), a single-parameter indexer declaration ([§15.9](classes.md#159-indexers)), or in an operator declaration ([§15.10.1](classes.md#15101-general)) the compiler should give a warning, since these members can never be invoked in a way that permits arguments to be omitted. -A *parameter_array* consists of an optional set of *attributes* ([§22](attributes.md#22-attributes)), a `params` modifier, an *array_type*, and an *identifier*. A parameter array declares a single parameter of the given array type with the given name. The *array_type* of a parameter array shall be a single-dimensional array type ([§17.2](arrays.md#172-array-types)). In a method invocation, a parameter array permits either a single argument of the given array type to be specified, or it permits zero or more arguments of the array element type to be specified. Parameter arrays are described further in [§15.6.2.5](classes.md#15625-parameter-arrays). +A *parameter_array* consists of an optional set of *attributes* ([§22](attributes.md#22-attributes)), a `params` modifier, an *array_type*, and an *Identifier*. A parameter array declares a single parameter of the given array type with the given name. The *array_type* of a parameter array shall be a single-dimensional array type ([§17.2](arrays.md#172-array-types)). In a method invocation, a parameter array permits either a single argument of the given array type to be specified, or it permits zero or more arguments of the array element type to be specified. Parameter arrays are described further in [§15.6.2.5](classes.md#15625-parameter-arrays). A *parameter_array* may occur after an optional parameter, but cannot have a default value – the omission of arguments for a *parameter_array* would instead result in the creation of an empty array. @@ -2557,7 +2557,7 @@ A *property_declaration* may include a set of *attributes* ([§22](attributes.md Property declarations are subject to the same rules as method declarations ([§15.6](classes.md#156-methods)) with regard to valid combinations of modifiers. -The *type* of a property declaration specifies the type of the property introduced by the declaration, and the *member_name* ([§15.6.1](classes.md#1561-general)) specifies the name of the property. Unless the property is an explicit interface member implementation, the *member_name* is simply an *identifier*. For an explicit interface member implementation ([§18.6.2](interfaces.md#1862-explicit-interface-member-implementations)), the *member_name* consists of an *interface_type* followed by a "`.`" and an *identifier*. +The *type* of a property declaration specifies the type of the property introduced by the declaration, and the *member_name* ([§15.6.1](classes.md#1561-general)) specifies the name of the property. Unless the property is an explicit interface member implementation, the *member_name* is simply an *Identifier*. For an explicit interface member implementation ([§18.6.2](interfaces.md#1862-explicit-interface-member-implementations)), the *member_name* consists of an *interface_type* followed by a "`.`" and an *Identifier*. The *type* of a property shall be at least as accessible as the property itself ([§8.5.5](basic-concepts.md#855-accessibility-constraints)). @@ -3427,7 +3427,7 @@ binary_operator_declarator overloadable_binary_operator : '+' | '-' | '*' | '/' | '%' | '&' | '|' | '^' | '<<' - | right_shift | '==' | '!=' | '>' | '<' | '>=' | '<=' + | Right_shift | '==' | '!=' | '>' | '<' | '>=' | '<=' ; conversion_operator_declarator @@ -3639,7 +3639,7 @@ constructor_modifier ; constructor_declarator - : identifier '(' formal_parameter_list? ')' constructor_initializer? + : Identifier '(' formal_parameter_list? ')' constructor_initializer? ; constructor_initializer @@ -3655,7 +3655,7 @@ constructor_body A *constructor_declaration* may include a set of *attributes* ([§22](attributes.md#22-attributes)), a valid combination of the four access modifiers ([§15.3.6](classes.md#1536-access-modifiers)), and an `extern` ([§15.6.8](classes.md#1568-external-methods)) modifier. A constructor declaration is not permitted to include the same modifier multiple times. -The *identifier* of a *constructor_declarator* shall name the class in which the instance constructor is declared. If any other name is specified, a compile-time error occurs. +The *Identifier* of a *constructor_declarator* shall name the class in which the instance constructor is declared. If any other name is specified, a compile-time error occurs. The optional *formal_parameter_list* of an instance constructor is subject to the same rules as the *formal_parameter_list* of a method ([§15.6](classes.md#156-methods)). As the `this` modifier for parameters only applies to extension methods ([§15.6.10](classes.md#15610-extension-methods)), no parameter in a constructor's *formal_parameter_list* shall contain the `this` modifier. The formal parameter list defines the signature ([§8.6](basic-concepts.md#86-signatures-and-overloading)) of an instance constructor and governs the process whereby overload resolution ([§12.6.4](expressions.md#1264-overload-resolution)) selects a particular instance constructor in an invocation. @@ -3847,7 +3847,7 @@ A ***static constructor*** is a member that implements the actions required to i ```ANTLR static_constructor_declaration - : attributes? static_constructor_modifiers identifier '(' ')' static_constructor_body + : attributes? static_constructor_modifiers Identifier '(' ')' static_constructor_body ; static_constructor_modifiers @@ -3863,7 +3863,7 @@ static_constructor_body A *static_constructor_declaration* may include a set of *attributes* ([§22](attributes.md#22-attributes)) and an `extern` modifier ([§15.6.8](classes.md#1568-external-methods)). -The *identifier* of a *static_constructor_declaration* shall name the class in which the static constructor is declared. If any other name is specified, a compile-time error occurs. +The *Identifier* of a *static_constructor_declaration* shall name the class in which the static constructor is declared. If any other name is specified, a compile-time error occurs. When a static constructor declaration includes an `extern` modifier, the static constructor is said to be an ***external static constructor***. Because an external static constructor declaration provides no actual implementation, its *static_constructor_body* consists of a semicolon. For all other static constructor declarations, the *static_constructor_body* consists of a *block*, which specifies the statements to execute in order to initialize the class. This corresponds exactly to the *method_body* of a static method with a `void` return type ([§15.6.11](classes.md#15611-method-body)). @@ -3967,7 +3967,7 @@ A ***finalizer*** is a member that implements the actions required to finalize a ```ANTLR finalizer_declaration - : attributes? 'extern'? '~' identifier '(' ')' finalizer_body + : attributes? 'extern'? '~' Identifier '(' ')' finalizer_body ; finalizer_body @@ -3978,7 +3978,7 @@ finalizer_body A *finalizer_declaration* may include a set of *attributes* ([§22](attributes.md#22-attributes)). -The *identifier* of a *finalizer_declarator* shall name the class in which the finalizer is declared. If any other name is specified, a compile-time error occurs. +The *Identifier* of a *finalizer_declarator* shall name the class in which the finalizer is declared. If any other name is specified, a compile-time error occurs. When a finalizer declaration includes an `extern` modifier, the finalizer is said to be an ***external finalizer***. Because an external finalizer declaration provides no actual implementation, its *finalizer_body* consists of a semicolon. For all other finalizers, the *finalizer_body* consists of a *block*, which specifies the statements to execute in order to finalize an instance of the class. A *finalizer_body* corresponds exactly to the *method_body* of an instance method with a `void` return type ([§15.6.11](classes.md#15611-method-body)). From 27fcb4ab67e25a8f4c2903b2476a258e797af4a6 Mon Sep 17 00:00:00 2001 From: Rex Jaeschke Date: Sat, 16 Jan 2021 09:43:04 -0500 Subject: [PATCH 12/13] Update expressions.md --- standard/expressions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/standard/expressions.md b/standard/expressions.md index 9b3b4a219..828f70ddb 100644 --- a/standard/expressions.md +++ b/standard/expressions.md @@ -2221,11 +2221,11 @@ The `typeof` operator can be used on a type parameter. The result is the `System ### 12.7.13 The sizeof operator -The `sizeof` operator returns the number of 8-bit bytes occupied by a variable of a given type. The type specified as an operand to sizeof shall be an *Unmanaged_Type* ([§23.3](unsafe-code.md#233-pointer-types)). +The `sizeof` operator returns the number of 8-bit bytes occupied by a variable of a given type. The type specified as an operand to sizeof shall be an *unmanaged_type* ([§23.3](unsafe-code.md#233-pointer-types)). ```ANTLR sizeof_expression - : 'sizeof' '(' Unmanaged_Type ')' + : 'sizeof' '(' unmanaged_type ')' ; ``` From 89590e969a3313ab343b507fdd81ce5d442ad582 Mon Sep 17 00:00:00 2001 From: Rex Jaeschke Date: Sat, 16 Jan 2021 10:08:23 -0500 Subject: [PATCH 13/13] Update variables.md --- standard/variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard/variables.md b/standard/variables.md index 124d4f545..5d17c37b0 100644 --- a/standard/variables.md +++ b/standard/variables.md @@ -421,7 +421,7 @@ finally *finally_block* For a `foreach` statement *stmt* of the form: -`foreach (` *type* *identifier* `in` *expr* `)` *embedded_statement* +`foreach (` *type* *Identifier* `in` *expr* `)` *embedded_statement* - The definite assignment state of *v* at the beginning of *expr* is the same as the state of *v* at the beginning of *stmt*. - The definite assignment state of *v* on the control flow transfer to *embedded_statement* or to the end point of *stmt* is the same as the state of *v* at the end of *expr*.