Skip to content

Commit cd3310a

Browse files
[create-pull-request] automated change (#1295)
Co-authored-by: jskeet <[email protected]>
1 parent 8306316 commit cd3310a

File tree

1 file changed

+35
-46
lines changed

1 file changed

+35
-46
lines changed

standard/grammar.md

Lines changed: 35 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ input_element
4141
// Source: §6.3.2 Line terminators
4242
New_Line
4343
: New_Line_Character
44-
| '\u000D\u000A' // carriage return, line feed
44+
| '\u000D\u000A' // carriage return, line feed
4545
;
4646
4747
// Source: §6.3.3 Comments
@@ -58,19 +58,19 @@ fragment Input_Character
5858
// anything but New_Line_Character
5959
: ~('\u000D' | '\u000A' | '\u0085' | '\u2028' | '\u2029')
6060
;
61-
61+
6262
fragment New_Line_Character
6363
: '\u000D' // carriage return
6464
| '\u000A' // line feed
6565
| '\u0085' // next line
6666
| '\u2028' // line separator
6767
| '\u2029' // paragraph separator
6868
;
69-
69+
7070
fragment Delimited_Comment
7171
: '/*' Delimited_Comment_Section* ASTERISK+ '/'
7272
;
73-
73+
7474
fragment Delimited_Comment_Section
7575
: SLASH
7676
| ASTERISK* Not_Slash_Or_Asterisk
@@ -125,7 +125,7 @@ fragment Available_Identifier
125125
fragment Escaped_Identifier
126126
// Includes keywords and contextual keywords prefixed by '@'.
127127
// See note below.
128-
: '@' Basic_Identifier
128+
: '@' Basic_Identifier
129129
;
130130
131131
fragment Basic_Identifier
@@ -246,36 +246,36 @@ fragment Decimal_Integer_Literal
246246
fragment Decorated_Decimal_Digit
247247
: '_'* Decimal_Digit
248248
;
249-
249+
250250
fragment Decimal_Digit
251251
: '0'..'9'
252252
;
253-
253+
254254
fragment Integer_Type_Suffix
255255
: 'U' | 'u' | 'L' | 'l' |
256256
'UL' | 'Ul' | 'uL' | 'ul' | 'LU' | 'Lu' | 'lU' | 'lu'
257257
;
258-
258+
259259
fragment Hexadecimal_Integer_Literal
260260
: ('0x' | '0X') Decorated_Hex_Digit+ Integer_Type_Suffix?
261261
;
262262
263263
fragment Decorated_Hex_Digit
264264
: '_'* Hex_Digit
265265
;
266-
266+
267267
fragment Hex_Digit
268268
: '0'..'9' | 'A'..'F' | 'a'..'f'
269269
;
270-
270+
271271
fragment Binary_Integer_Literal
272272
: ('0b' | '0B') Decorated_Binary_Digit+ Integer_Type_Suffix?
273273
;
274274
275275
fragment Decorated_Binary_Digit
276276
: '_'* Binary_Digit
277277
;
278-
278+
279279
fragment Binary_Digit
280280
: '0' | '1'
281281
;
@@ -305,24 +305,24 @@ fragment Real_Type_Suffix
305305
Character_Literal
306306
: '\'' Character '\''
307307
;
308-
308+
309309
fragment Character
310310
: Single_Character
311311
| Simple_Escape_Sequence
312312
| Hexadecimal_Escape_Sequence
313313
| Unicode_Escape_Sequence
314314
;
315-
315+
316316
fragment Single_Character
317317
// anything but ', \, and New_Line_Character
318318
: ~['\\\u000D\u000A\u0085\u2028\u2029]
319319
;
320-
320+
321321
fragment Simple_Escape_Sequence
322322
: '\\\'' | '\\"' | '\\\\' | '\\0' | '\\a' | '\\b' |
323323
'\\f' | '\\n' | '\\r' | '\\t' | '\\v'
324324
;
325-
325+
326326
fragment Hexadecimal_Escape_Sequence
327327
: '\\x' Hex_Digit Hex_Digit? Hex_Digit? Hex_Digit?
328328
;
@@ -332,11 +332,11 @@ String_Literal
332332
: Regular_String_Literal
333333
| Verbatim_String_Literal
334334
;
335-
335+
336336
fragment Regular_String_Literal
337337
: '"' Regular_String_Literal_Character* '"'
338338
;
339-
339+
340340
fragment Regular_String_Literal_Character
341341
: Single_Regular_String_Literal_Character
342342
| Simple_Escape_Sequence
@@ -352,16 +352,16 @@ fragment Single_Regular_String_Literal_Character
352352
fragment Verbatim_String_Literal
353353
: '@"' Verbatim_String_Literal_Character* '"'
354354
;
355-
355+
356356
fragment Verbatim_String_Literal_Character
357357
: Single_Verbatim_String_Literal_Character
358358
| Quote_Escape_Sequence
359359
;
360-
360+
361361
fragment Single_Verbatim_String_Literal_Character
362362
: ~["] // anything but quotation mark (U+0022)
363363
;
364-
364+
365365
fragment Quote_Escape_Sequence
366366
: '""'
367367
;
@@ -431,11 +431,11 @@ fragment PP_Conditional_Symbol
431431
fragment PP_Expression
432432
: PP_Whitespace? PP_Or_Expression PP_Whitespace?
433433
;
434-
434+
435435
fragment PP_Or_Expression
436436
: PP_And_Expression (PP_Whitespace? '||' PP_Whitespace? PP_And_Expression)*
437437
;
438-
438+
439439
fragment PP_And_Expression
440440
: PP_Equality_Expression (PP_Whitespace? '&&' PP_Whitespace?
441441
PP_Equality_Expression)*
@@ -445,12 +445,12 @@ fragment PP_Equality_Expression
445445
: PP_Unary_Expression (PP_Whitespace? ('==' | '!=') PP_Whitespace?
446446
PP_Unary_Expression)*
447447
;
448-
448+
449449
fragment PP_Unary_Expression
450450
: PP_Primary_Expression
451451
| '!' PP_Whitespace? PP_Unary_Expression
452452
;
453-
453+
454454
fragment PP_Primary_Expression
455455
: TRUE
456456
| FALSE
@@ -475,15 +475,15 @@ fragment PP_Conditional
475475
fragment PP_If_Section
476476
: 'if' PP_Whitespace PP_Expression
477477
;
478-
478+
479479
fragment PP_Elif_Section
480480
: 'elif' PP_Whitespace PP_Expression
481481
;
482-
482+
483483
fragment PP_Else_Section
484484
: 'else'
485485
;
486-
486+
487487
fragment PP_Endif
488488
: 'endif'
489489
;
@@ -523,11 +523,11 @@ fragment PP_Line_Indicator
523523
| DEFAULT
524524
| 'hidden'
525525
;
526-
526+
527527
fragment PP_Compilation_Unit_Name
528528
: '"' PP_Compilation_Unit_Name_Character* '"'
529529
;
530-
530+
531531
fragment PP_Compilation_Unit_Name_Character
532532
// Any Input_Character except "
533533
: ~('\u000D' | '\u000A' | '\u0085' | '\u2028' | '\u2029' | '"')
@@ -1092,8 +1092,7 @@ element_initializer
10921092
;
10931093
10941094
expression_list
1095-
: expression
1096-
| expression_list ',' expression
1095+
: expression (',' expression)*
10971096
;
10981097
10991098
// Source: §12.8.17.3 Anonymous object creation expressions
@@ -1410,12 +1409,7 @@ from_clause
14101409
;
14111410
14121411
query_body
1413-
: query_body_clauses? select_or_group_clause query_continuation?
1414-
;
1415-
1416-
query_body_clauses
1417-
: query_body_clause
1418-
| query_body_clauses query_body_clause
1412+
: query_body_clause* select_or_group_clause query_continuation?
14191413
;
14201414
14211415
query_body_clause
@@ -1948,12 +1942,11 @@ class_modifier
19481942
19491943
// Source: §15.2.3 Type parameters
19501944
type_parameter_list
1951-
: '<' type_parameters '>'
1945+
: '<' decorated_type_parameter (',' decorated_type_parameter)* '>'
19521946
;
19531947
1954-
type_parameters
1948+
decorated_type_parameter
19551949
: attributes? type_parameter
1956-
| type_parameters ',' attributes? type_parameter
19571950
;
19581951
19591952
// Source: §15.2.4.1 General
@@ -2508,17 +2501,13 @@ interface_modifier
25082501
25092502
// Source: §18.2.3.1 General
25102503
variant_type_parameter_list
2511-
: '<' variant_type_parameters '>'
2504+
: '<' variant_type_parameter (',' variant_type_parameter)* '>'
25122505
;
25132506
2514-
// Source: §18.2.3.1 General
2515-
variant_type_parameters
2507+
variant_type_parameter
25162508
: attributes? variance_annotation? type_parameter
2517-
| variant_type_parameters ',' attributes? variance_annotation?
2518-
type_parameter
25192509
;
25202510
2521-
// Source: §18.2.3.1 General
25222511
variance_annotation
25232512
: 'in'
25242513
| 'out'

0 commit comments

Comments
 (0)