Skip to content

Commit 16fdcab

Browse files
[create-pull-request] automated change (#547)
Co-authored-by: jskeet <[email protected]>
1 parent 2cc534d commit 16fdcab

File tree

1 file changed

+71
-39
lines changed

1 file changed

+71
-39
lines changed

standard/grammar.md

Lines changed: 71 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ token
102102
// Source: §6.4.2 Unicode character escape sequences
103103
fragment Unicode_Escape_Sequence
104104
: '\\u' Hex_Digit Hex_Digit Hex_Digit Hex_Digit
105-
| '\\U' Hex_Digit Hex_Digit Hex_Digit Hex_Digit Hex_Digit Hex_Digit Hex_Digit Hex_Digit
105+
| '\\U' Hex_Digit Hex_Digit Hex_Digit Hex_Digit
106+
Hex_Digit Hex_Digit Hex_Digit Hex_Digit
106107
;
107108
108109
// Source: §6.4.3 Identifiers
@@ -117,11 +118,13 @@ Simple_Identifier
117118
;
118119
119120
fragment Available_Identifier
120-
: Basic_Identifier // excluding keywords or contextual keywords, see note below
121+
// excluding keywords or contextual keywords, see note below
122+
: Basic_Identifier
121123
;
122124
123125
fragment Escaped_Identifier
124-
// Includes keywords and contextual keywords prefixed by '@'. See note below.
126+
// Includes keywords and contextual keywords prefixed by '@'.
127+
// See note below.
125128
: '@' Basic_Identifier
126129
;
127130
@@ -243,7 +246,8 @@ fragment Decimal_Digit
243246
;
244247
245248
fragment Integer_Type_Suffix
246-
: 'U' | 'u' | 'L' | 'l' | 'UL' | 'Ul' | 'uL' | 'ul' | 'LU' | 'Lu' | 'lU' | 'lu'
249+
: 'U' | 'u' | 'L' | 'l' |
250+
'UL' | 'Ul' | 'uL' | 'ul' | 'LU' | 'Lu' | 'lU' | 'lu'
247251
;
248252
249253
fragment Hexadecimal_Integer_Literal
@@ -287,11 +291,13 @@ fragment Character
287291
;
288292
289293
fragment Single_Character
290-
: ~['\\\u000D\u000A\u0085\u2028\u2029] // anything but ', \, and New_Line_Character
294+
// anything but ', \, and New_Line_Character
295+
: ~['\\\u000D\u000A\u0085\u2028\u2029]
291296
;
292297
293298
fragment Simple_Escape_Sequence
294-
: '\\\'' | '\\"' | '\\\\' | '\\0' | '\\a' | '\\b' | '\\f' | '\\n' | '\\r' | '\\t' | '\\v'
299+
: '\\\'' | '\\"' | '\\\\' | '\\0' | '\\a' | '\\b' |
300+
'\\f' | '\\n' | '\\r' | '\\t' | '\\v'
295301
;
296302
297303
fragment Hexadecimal_Escape_Sequence
@@ -316,7 +322,8 @@ fragment Regular_String_Literal_Character
316322
;
317323
318324
fragment Single_Regular_String_Literal_Character
319-
: ~["\\\u000D\u000A\u0085\u2028\u2029] // anything but ", \, and New_Line_Character
325+
// anything but ", \, and New_Line_Character
326+
: ~["\\\u000D\u000A\u0085\u2028\u2029]
320327
;
321328
322329
fragment Verbatim_String_Literal
@@ -344,7 +351,7 @@ null_literal
344351
// Source: §6.4.6 Operators and punctuators
345352
operator_or_punctuator
346353
: '{' | '}' | '[' | ']' | '(' | ')' | '.' | ',' | ':' | ';'
347-
| '+' | '-' | ASTERISK | SLASH | '%' | '&' | '|' | '^' | '!' | '~'
354+
| '+' | '-' | ASTERISK | SLASH | '%' | '&' | '|' | '^' | '!' | '~'
348355
| '=' | '<' | '>' | '?' | '??' | '::' | '++' | '--' | '&&' | '||'
349356
| '->' | '==' | '!=' | '<=' | '>=' | '+=' | '-=' | '*=' | '/=' | '%='
350357
| '&=' | '|=' | '^=' | '<<' | '<<=' | '=>'
@@ -374,7 +381,8 @@ fragment PP_Kind
374381
375382
// Only recognised at the beginning of a line
376383
fragment PP_Start
377-
: { getCharPositionInLine() == 0 }? PP_Whitespace? '#' PP_Whitespace? // see note below
384+
// See note below.
385+
: { getCharPositionInLine() == 0 }? PP_Whitespace? '#' PP_Whitespace?
378386
;
379387
380388
fragment PP_Whitespace
@@ -391,7 +399,8 @@ fragment PP_New_Line
391399
392400
// Source: §6.5.2 Conditional compilation symbols
393401
fragment PP_Conditional_Symbol
394-
: Basic_Identifier // must not be equal to tokens TRUE or FALSE, see note below
402+
// Must not be equal to tokens TRUE or FALSE. See note below.
403+
: Basic_Identifier
395404
;
396405
397406
// Source: §6.5.3 Pre-processing expressions
@@ -727,7 +736,8 @@ interpolated_regular_string_expression
727736
;
728737
729738
regular_interpolation
730-
: expression (',' interpolation_minimum_width)? Regular_Interpolation_Format?
739+
: expression (',' interpolation_minimum_width)?
740+
Regular_Interpolation_Format?
731741
;
732742
733743
interpolation_minimum_width
@@ -776,7 +786,8 @@ interpolated_verbatim_string_expression
776786
;
777787
778788
verbatim_interpolation
779-
: expression (',' interpolation_minimum_width)? Verbatim_Interpolation_Format?
789+
: expression (',' interpolation_minimum_width)?
790+
Verbatim_Interpolation_Format?
780791
;
781792
782793
Interpolated_Verbatim_String_Start
@@ -836,13 +847,15 @@ member_access
836847
;
837848
838849
predefined_type
839-
: 'bool' | 'byte' | 'char' | 'decimal' | 'double' | 'float' | 'int' | 'long'
840-
| 'object' | 'sbyte' | 'short' | 'string' | 'uint' | 'ulong' | 'ushort'
850+
: 'bool' | 'byte' | 'char' | 'decimal' | 'double' | 'float' | 'int'
851+
| 'long' | 'object' | 'sbyte' | 'short' | 'string' | 'uint' | 'ulong'
852+
| 'ushort'
841853
;
842854
843855
// Source: §11.7.7 Null Conditional Member Access
844856
null_conditional_member_access
845-
: primary_expression '?' '.' identifier type_argument_list? dependent_access*
857+
: primary_expression '?' '.' identifier type_argument_list?
858+
dependent_access*
846859
;
847860
848861
dependent_access
@@ -873,7 +886,8 @@ element_access
873886
874887
// Source: §11.7.11 Null Conditional Element Access
875888
null_conditional_element_access
876-
: primary_no_array_creation_expression '?' '[' argument_list ']' dependent_access*
889+
: primary_no_array_creation_expression '?' '[' argument_list ']'
890+
dependent_access*
877891
;
878892
879893
// Source: §11.7.12 This access
@@ -953,7 +967,8 @@ expression_list
953967
954968
// Source: §11.7.15.5 Array creation expressions
955969
array_creation_expression
956-
: 'new' non_array_type '[' expression_list ']' rank_specifier* array_initializer?
970+
: 'new' non_array_type '[' expression_list ']' rank_specifier*
971+
array_initializer?
957972
| 'new' array_type array_initializer
958973
| 'new' rank_specifier array_initializer
959974
;
@@ -1173,7 +1188,8 @@ explicit_anonymous_function_signature
11731188
;
11741189
11751190
explicit_anonymous_function_parameter_list
1176-
: explicit_anonymous_function_parameter (',' explicit_anonymous_function_parameter)*
1191+
: explicit_anonymous_function_parameter
1192+
(',' explicit_anonymous_function_parameter)*
11771193
;
11781194
11791195
explicit_anonymous_function_parameter
@@ -1191,7 +1207,8 @@ implicit_anonymous_function_signature
11911207
;
11921208
11931209
implicit_anonymous_function_parameter_list
1194-
: implicit_anonymous_function_parameter (',' implicit_anonymous_function_parameter)*
1210+
: implicit_anonymous_function_parameter
1211+
(',' implicit_anonymous_function_parameter)*
11951212
;
11961213
11971214
implicit_anonymous_function_parameter
@@ -1240,12 +1257,13 @@ where_clause
12401257
;
12411258
12421259
join_clause
1243-
: 'join' type? identifier 'in' expression 'on' expression 'equals' expression
1260+
: 'join' type? identifier 'in' expression 'on' expression
1261+
'equals' expression
12441262
;
12451263
12461264
join_into_clause
1247-
: 'join' type? identifier 'in' expression 'on' expression 'equals' expression
1248-
'into' identifier
1265+
: 'join' type? identifier 'in' expression 'on' expression
1266+
'equals' expression 'into' identifier
12491267
;
12501268
12511269
orderby_clause
@@ -1429,7 +1447,8 @@ selection_statement
14291447
// Source: §12.8.2 The if statement
14301448
if_statement
14311449
: 'if' '(' boolean_expression ')' embedded_statement
1432-
| 'if' '(' boolean_expression ')' embedded_statement 'else' embedded_statement
1450+
| 'if' '(' boolean_expression ')' embedded_statement
1451+
'else' embedded_statement
14331452
;
14341453
14351454
// Source: §12.8.3 The switch statement
@@ -1470,7 +1489,8 @@ do_statement
14701489
14711490
// Source: §12.9.4 The for statement
14721491
for_statement
1473-
: 'for' '(' for_initializer? ';' for_condition? ';' for_iterator? ')' embedded_statement
1492+
: 'for' '(' for_initializer? ';' for_condition? ';' for_iterator? ')'
1493+
embedded_statement
14741494
;
14751495
14761496
for_initializer
@@ -1492,7 +1512,8 @@ statement_expression_list
14921512
14931513
// Source: §12.9.5 The foreach statement
14941514
foreach_statement
1495-
: 'foreach' '(' local_variable_type identifier 'in' expression ')' embedded_statement
1515+
: 'foreach' '(' local_variable_type identifier 'in' expression ')'
1516+
embedded_statement
14961517
;
14971518
14981519
// Source: §12.10.1 General
@@ -1609,7 +1630,8 @@ qualified_identifier
16091630
;
16101631
16111632
namespace_body
1612-
: '{' extern_alias_directive* using_directive* namespace_member_declaration* '}'
1633+
: '{' extern_alias_directive* using_directive*
1634+
namespace_member_declaration* '}'
16131635
;
16141636
16151637
// Source: §13.4 Extern alias directives
@@ -1661,8 +1683,9 @@ qualified_alias_member
16611683
16621684
// Source: §14.2.1 General
16631685
class_declaration
1664-
: attributes? class_modifier* 'partial'? 'class' identifier type_parameter_list?
1665-
class_base? type_parameter_constraints_clause* class_body ';'?
1686+
: attributes? class_modifier* 'partial'? 'class' identifier
1687+
type_parameter_list? class_base? type_parameter_constraints_clause*
1688+
class_body ';'?
16661689
;
16671690
16681691
// Source: §14.2.2.1 General
@@ -1800,8 +1823,9 @@ method_declaration
18001823
;
18011824
18021825
method_header
1803-
: attributes? method_modifier* 'partial'? return_type member_name type_parameter_list?
1804-
'(' formal_parameter_list? ')' type_parameter_constraints_clause*
1826+
: attributes? method_modifier* 'partial'? return_type member_name
1827+
type_parameter_list? '(' formal_parameter_list? ')'
1828+
type_parameter_constraints_clause*
18051829
;
18061830
18071831
method_modifier
@@ -1929,7 +1953,8 @@ accessor_body
19291953
// Source: §14.8.1 General
19301954
event_declaration
19311955
: attributes? event_modifier* 'event' type variable_declarators ';'
1932-
| attributes? event_modifier* 'event' type member_name '{' event_accessor_declarations '}'
1956+
| attributes? event_modifier* 'event' type member_name
1957+
'{' event_accessor_declarations '}'
19331958
;
19341959
19351960
event_modifier
@@ -2016,7 +2041,8 @@ overloadable_unary_operator
20162041
;
20172042
20182043
binary_operator_declarator
2019-
: type 'operator' overloadable_binary_operator '(' fixed_parameter ',' fixed_parameter ')'
2044+
: type 'operator' overloadable_binary_operator
2045+
'(' fixed_parameter ',' fixed_parameter ')'
20202046
;
20212047
20222048
overloadable_binary_operator
@@ -2066,7 +2092,8 @@ constructor_body
20662092
20672093
// Source: §14.12 Static constructors
20682094
static_constructor_declaration
2069-
: attributes? static_constructor_modifiers identifier '(' ')' static_constructor_body
2095+
: attributes? static_constructor_modifiers identifier '(' ')'
2096+
static_constructor_body
20702097
;
20712098
20722099
static_constructor_modifiers
@@ -2087,8 +2114,10 @@ static_constructor_body
20872114
// Source: §14.13 Finalizers
20882115
finalizer_declaration
20892116
: attributes? '~' identifier '(' ')' finalizer_body
2090-
| attributes? 'extern' unsafe_modifier? '~' identifier '(' ')' finalizer_body
2091-
| attributes? unsafe_modifier 'extern'? '~' identifier '(' ')' finalizer_body
2117+
| attributes? 'extern' unsafe_modifier? '~' identifier '(' ')'
2118+
finalizer_body
2119+
| attributes? unsafe_modifier 'extern'? '~' identifier '(' ')'
2120+
finalizer_body
20922121
;
20932122
20942123
finalizer_body
@@ -2098,8 +2127,9 @@ finalizer_body
20982127
20992128
// Source: §15.2.1 General
21002129
struct_declaration
2101-
: attributes? struct_modifier* 'partial'? 'struct' identifier type_parameter_list?
2102-
struct_interfaces? type_parameter_constraints_clause* struct_body ';'?
2130+
: attributes? struct_modifier* 'partial'? 'struct' identifier
2131+
type_parameter_list? struct_interfaces?
2132+
type_parameter_constraints_clause* struct_body ';'?
21032133
;
21042134
21052135
// Source: §15.2.2 Struct modifiers
@@ -2177,7 +2207,8 @@ variant_type_parameter_list
21772207
// Source: §17.2.3.1 General
21782208
variant_type_parameters
21792209
: attributes? variance_annotation? type_parameter
2180-
| variant_type_parameters ',' attributes? variance_annotation? type_parameter
2210+
| variant_type_parameters ',' attributes? variance_annotation?
2211+
type_parameter
21812212
;
21822213
21832214
// Source: §17.2.3.1 General
@@ -2230,7 +2261,8 @@ interface_event_declaration
22302261
22312262
// Source: §17.4.5 Interface indexers
22322263
interface_indexer_declaration:
2233-
attributes? 'new'? type 'this' '[' formal_parameter_list ']' '{' interface_accessors '}'
2264+
attributes? 'new'? type 'this' '[' formal_parameter_list ']'
2265+
'{' interface_accessors '}'
22342266
;
22352267
22362268
// Source: §18.2 Enum declarations

0 commit comments

Comments
 (0)