@@ -102,7 +102,8 @@ token
102
102
// Source: §6.4.2 Unicode character escape sequences
103
103
fragment Unicode_Escape_Sequence
104
104
: '\\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
106
107
;
107
108
108
109
// Source: §6.4.3 Identifiers
@@ -117,11 +118,13 @@ Simple_Identifier
117
118
;
118
119
119
120
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
121
123
;
122
124
123
125
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.
125
128
: '@' Basic_Identifier
126
129
;
127
130
@@ -243,7 +246,8 @@ fragment Decimal_Digit
243
246
;
244
247
245
248
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'
247
251
;
248
252
249
253
fragment Hexadecimal_Integer_Literal
@@ -287,11 +291,13 @@ fragment Character
287
291
;
288
292
289
293
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]
291
296
;
292
297
293
298
fragment Simple_Escape_Sequence
294
- : '\\\'' | '\\"' | '\\\\' | '\\0' | '\\a' | '\\b' | '\\f' | '\\n' | '\\r' | '\\t' | '\\v'
299
+ : '\\\'' | '\\"' | '\\\\' | '\\0' | '\\a' | '\\b' |
300
+ '\\f' | '\\n' | '\\r' | '\\t' | '\\v'
295
301
;
296
302
297
303
fragment Hexadecimal_Escape_Sequence
@@ -316,7 +322,8 @@ fragment Regular_String_Literal_Character
316
322
;
317
323
318
324
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]
320
327
;
321
328
322
329
fragment Verbatim_String_Literal
@@ -344,7 +351,7 @@ null_literal
344
351
// Source: §6.4.6 Operators and punctuators
345
352
operator_or_punctuator
346
353
: '{' | '}' | '[' | ']' | '(' | ')' | '.' | ',' | ':' | ';'
347
- | '+' | '-' | ASTERISK | SLASH | '%' | '&' | '|' | '^' | '!' | '~'
354
+ | '+' | '-' | ASTERISK | SLASH | '%' | '&' | '|' | '^' | '!' | '~'
348
355
| '=' | '<' | '>' | '?' | '??' | '::' | '++' | '--' | '&&' | '||'
349
356
| '->' | '==' | '!=' | '<=' | '>=' | '+=' | '-=' | '*=' | '/=' | '%='
350
357
| '&=' | '|=' | '^=' | '<<' | '<<=' | '=>'
@@ -374,7 +381,8 @@ fragment PP_Kind
374
381
375
382
// Only recognised at the beginning of a line
376
383
fragment PP_Start
377
- : { getCharPositionInLine() == 0 }? PP_Whitespace? '#' PP_Whitespace? // see note below
384
+ // See note below.
385
+ : { getCharPositionInLine() == 0 }? PP_Whitespace? '#' PP_Whitespace?
378
386
;
379
387
380
388
fragment PP_Whitespace
@@ -391,7 +399,8 @@ fragment PP_New_Line
391
399
392
400
// Source: §6.5.2 Conditional compilation symbols
393
401
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
395
404
;
396
405
397
406
// Source: §6.5.3 Pre-processing expressions
@@ -727,7 +736,8 @@ interpolated_regular_string_expression
727
736
;
728
737
729
738
regular_interpolation
730
- : expression (',' interpolation_minimum_width)? Regular_Interpolation_Format?
739
+ : expression (',' interpolation_minimum_width)?
740
+ Regular_Interpolation_Format?
731
741
;
732
742
733
743
interpolation_minimum_width
@@ -776,7 +786,8 @@ interpolated_verbatim_string_expression
776
786
;
777
787
778
788
verbatim_interpolation
779
- : expression (',' interpolation_minimum_width)? Verbatim_Interpolation_Format?
789
+ : expression (',' interpolation_minimum_width)?
790
+ Verbatim_Interpolation_Format?
780
791
;
781
792
782
793
Interpolated_Verbatim_String_Start
@@ -836,13 +847,15 @@ member_access
836
847
;
837
848
838
849
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'
841
853
;
842
854
843
855
// Source: §11.7.7 Null Conditional Member Access
844
856
null_conditional_member_access
845
- : primary_expression '?' '.' identifier type_argument_list? dependent_access*
857
+ : primary_expression '?' '.' identifier type_argument_list?
858
+ dependent_access*
846
859
;
847
860
848
861
dependent_access
@@ -873,7 +886,8 @@ element_access
873
886
874
887
// Source: §11.7.11 Null Conditional Element Access
875
888
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*
877
891
;
878
892
879
893
// Source: §11.7.12 This access
@@ -953,7 +967,8 @@ expression_list
953
967
954
968
// Source: §11.7.15.5 Array creation expressions
955
969
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?
957
972
| 'new' array_type array_initializer
958
973
| 'new' rank_specifier array_initializer
959
974
;
@@ -1173,7 +1188,8 @@ explicit_anonymous_function_signature
1173
1188
;
1174
1189
1175
1190
explicit_anonymous_function_parameter_list
1176
- : explicit_anonymous_function_parameter (',' explicit_anonymous_function_parameter)*
1191
+ : explicit_anonymous_function_parameter
1192
+ (',' explicit_anonymous_function_parameter)*
1177
1193
;
1178
1194
1179
1195
explicit_anonymous_function_parameter
@@ -1191,7 +1207,8 @@ implicit_anonymous_function_signature
1191
1207
;
1192
1208
1193
1209
implicit_anonymous_function_parameter_list
1194
- : implicit_anonymous_function_parameter (',' implicit_anonymous_function_parameter)*
1210
+ : implicit_anonymous_function_parameter
1211
+ (',' implicit_anonymous_function_parameter)*
1195
1212
;
1196
1213
1197
1214
implicit_anonymous_function_parameter
@@ -1240,12 +1257,13 @@ where_clause
1240
1257
;
1241
1258
1242
1259
join_clause
1243
- : 'join' type? identifier 'in' expression 'on' expression 'equals' expression
1260
+ : 'join' type? identifier 'in' expression 'on' expression
1261
+ 'equals' expression
1244
1262
;
1245
1263
1246
1264
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
1249
1267
;
1250
1268
1251
1269
orderby_clause
@@ -1429,7 +1447,8 @@ selection_statement
1429
1447
// Source: §12.8.2 The if statement
1430
1448
if_statement
1431
1449
: 'if' '(' boolean_expression ')' embedded_statement
1432
- | 'if' '(' boolean_expression ')' embedded_statement 'else' embedded_statement
1450
+ | 'if' '(' boolean_expression ')' embedded_statement
1451
+ 'else' embedded_statement
1433
1452
;
1434
1453
1435
1454
// Source: §12.8.3 The switch statement
@@ -1470,7 +1489,8 @@ do_statement
1470
1489
1471
1490
// Source: §12.9.4 The for statement
1472
1491
for_statement
1473
- : 'for' '(' for_initializer? ';' for_condition? ';' for_iterator? ')' embedded_statement
1492
+ : 'for' '(' for_initializer? ';' for_condition? ';' for_iterator? ')'
1493
+ embedded_statement
1474
1494
;
1475
1495
1476
1496
for_initializer
@@ -1492,7 +1512,8 @@ statement_expression_list
1492
1512
1493
1513
// Source: §12.9.5 The foreach statement
1494
1514
foreach_statement
1495
- : 'foreach' '(' local_variable_type identifier 'in' expression ')' embedded_statement
1515
+ : 'foreach' '(' local_variable_type identifier 'in' expression ')'
1516
+ embedded_statement
1496
1517
;
1497
1518
1498
1519
// Source: §12.10.1 General
@@ -1609,7 +1630,8 @@ qualified_identifier
1609
1630
;
1610
1631
1611
1632
namespace_body
1612
- : '{' extern_alias_directive* using_directive* namespace_member_declaration* '}'
1633
+ : '{' extern_alias_directive* using_directive*
1634
+ namespace_member_declaration* '}'
1613
1635
;
1614
1636
1615
1637
// Source: §13.4 Extern alias directives
@@ -1661,8 +1683,9 @@ qualified_alias_member
1661
1683
1662
1684
// Source: §14.2.1 General
1663
1685
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 ';'?
1666
1689
;
1667
1690
1668
1691
// Source: §14.2.2.1 General
@@ -1800,8 +1823,9 @@ method_declaration
1800
1823
;
1801
1824
1802
1825
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*
1805
1829
;
1806
1830
1807
1831
method_modifier
@@ -1929,7 +1953,8 @@ accessor_body
1929
1953
// Source: §14.8.1 General
1930
1954
event_declaration
1931
1955
: 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 '}'
1933
1958
;
1934
1959
1935
1960
event_modifier
@@ -2016,7 +2041,8 @@ overloadable_unary_operator
2016
2041
;
2017
2042
2018
2043
binary_operator_declarator
2019
- : type 'operator' overloadable_binary_operator '(' fixed_parameter ',' fixed_parameter ')'
2044
+ : type 'operator' overloadable_binary_operator
2045
+ '(' fixed_parameter ',' fixed_parameter ')'
2020
2046
;
2021
2047
2022
2048
overloadable_binary_operator
@@ -2066,7 +2092,8 @@ constructor_body
2066
2092
2067
2093
// Source: §14.12 Static constructors
2068
2094
static_constructor_declaration
2069
- : attributes? static_constructor_modifiers identifier '(' ')' static_constructor_body
2095
+ : attributes? static_constructor_modifiers identifier '(' ')'
2096
+ static_constructor_body
2070
2097
;
2071
2098
2072
2099
static_constructor_modifiers
@@ -2087,8 +2114,10 @@ static_constructor_body
2087
2114
// Source: §14.13 Finalizers
2088
2115
finalizer_declaration
2089
2116
: 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
2092
2121
;
2093
2122
2094
2123
finalizer_body
@@ -2098,8 +2127,9 @@ finalizer_body
2098
2127
2099
2128
// Source: §15.2.1 General
2100
2129
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 ';'?
2103
2133
;
2104
2134
2105
2135
// Source: §15.2.2 Struct modifiers
@@ -2177,7 +2207,8 @@ variant_type_parameter_list
2177
2207
// Source: §17.2.3.1 General
2178
2208
variant_type_parameters
2179
2209
: attributes? variance_annotation? type_parameter
2180
- | variant_type_parameters ',' attributes? variance_annotation? type_parameter
2210
+ | variant_type_parameters ',' attributes? variance_annotation?
2211
+ type_parameter
2181
2212
;
2182
2213
2183
2214
// Source: §17.2.3.1 General
@@ -2230,7 +2261,8 @@ interface_event_declaration
2230
2261
2231
2262
// Source: §17.4.5 Interface indexers
2232
2263
interface_indexer_declaration:
2233
- attributes? 'new'? type 'this' '[' formal_parameter_list ']' '{' interface_accessors '}'
2264
+ attributes? 'new'? type 'this' '[' formal_parameter_list ']'
2265
+ '{' interface_accessors '}'
2234
2266
;
2235
2267
2236
2268
// Source: §18.2 Enum declarations
0 commit comments