Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 37 additions & 22 deletions standard/grammar.md
Original file line number Diff line number Diff line change
Expand Up @@ -2187,14 +2187,14 @@ qualified_alias_member

// Source: §15.2.1 General
class_declaration
: attributes? class_modifier* 'partial'? class_tag identifier
type_parameter_list? delimited_parameter_list? class_base?
type_parameter_constraints_clause* class_body
: non_record_class_declaration
| record_class_declaration
;

class_tag
: 'record'? 'class'
| 'record'
non_record_class_declaration
: attributes? class_modifier* 'partial'? 'class' identifier
type_parameter_list? class_base? type_parameter_constraints_clause*
class_body
;

// Source: §15.2.2.1 General
Expand Down Expand Up @@ -2226,10 +2226,6 @@ class_base
| ':' class_type base_argument_list? ',' interface_type_list
;

base_argument_list
: '(' argument_list? ')'
;

interface_type_list
: interface_type (',' interface_type)*
;
Expand Down Expand Up @@ -2270,7 +2266,6 @@ constructor_constraint
// Source: §15.2.6 Class body
class_body
: '{' class_member_declaration* '}' ';'?
| ';'
;

// Source: §15.3.1 General
Expand Down Expand Up @@ -2711,6 +2706,24 @@ finalizer_body
| ';'
;

// Source: §15.16.1 General
record_class_declaration
: attributes? class_modifier* 'partial'? 'record' 'class'? identifier
type_parameter_list? delimited_parameter_list? class_base?
type_parameter_constraints_clause* record_class_body
;

// Source: §15.16.2 Class base specification
base_argument_list
: '(' argument_list? ')'
;

// Source: §15.16.3 Record class body
record_class_body
: class_body
| ';'
;

// Source: §16.2.1 General
struct_declaration
: non_record_struct_declaration
Expand All @@ -2723,17 +2736,6 @@ non_record_struct_declaration
type_parameter_constraints_clause* struct_body ';'?
;

record_struct_declaration
: attributes? struct_modifier* 'partial'? 'record' 'struct'
identifier type_parameter_list? delimited_parameter_list? struct_interfaces?
type_parameter_constraints_clause* record_struct_body
;

record_struct_body
: struct_body ';'?
| ';'
;

// Source: §16.2.2 Struct modifiers
struct_modifier
: 'new'
Expand Down Expand Up @@ -2770,6 +2772,19 @@ struct_member_declaration
| fixed_size_buffer_declaration // unsafe code support
;

// Source: §16.4.1 General
record_struct_declaration
: attributes? struct_modifier* 'partial'? 'record' 'struct'
identifier type_parameter_list? delimited_parameter_list? struct_interfaces?
type_parameter_constraints_clause* record_struct_body
;

// Source: §16.4.3 Record struct body
record_struct_body
: struct_body ';'?
| ';'
;

// Source: §17.7 Array initializers
array_initializer
: '{' variable_initializer_list? '}'
Expand Down
Loading