Skip to content

Commit 6e272fc

Browse files
authored
Make grammar-line indenting consistent (#575)
* Set grammar line indent to 4 * indent grammar line to 4
1 parent ab9e699 commit 6e272fc

File tree

2 files changed

+119
-120
lines changed

2 files changed

+119
-120
lines changed

standard/classes.md

Lines changed: 117 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ A *class_declaration* is a *type_declaration* ([§13.7](namespaces.md#137-type-d
1212

1313
```ANTLR
1414
class_declaration
15-
: attributes? class_modifier* 'partial'? 'class' identifier
16-
type_parameter_list? class_base? type_parameter_constraints_clause*
17-
class_body ';'?
18-
;
15+
: attributes? class_modifier* 'partial'? 'class' identifier
16+
type_parameter_list? class_base? type_parameter_constraints_clause*
17+
class_body ';'?
18+
;
1919
```
2020

2121
A *class_declaration* consists of an optional set of *attributes* ([§21](attributes.md#21-attributes)), followed by an optional set of *class_modifier*s ([§14.2.2](classes.md#1422-class-modifiers)), followed by an optional `partial` modifier ([§14.2.7](classes.md#1427-partial-declarations)), followed by the keyword `class` and an *identifier* that names the class, followed by an optional *type_parameter_list* ([§14.2.3](classes.md#1423-type-parameters)), followed by an optional *class_base* specification ([§14.2.4](classes.md#1424-class-base-specification)), followed by an optional set of *type_parameter_constraints_clause*s ([§14.2.5](classes.md#1425-type-parameter-constraints)), followed by a *class_body* ([§14.2.6](classes.md#1426-class-body)), optionally followed by a semicolon.
@@ -147,13 +147,13 @@ A type parameter is a simple identifier that denotes a placeholder for a type ar
147147
148148
```ANTLR
149149
type_parameter_list
150-
: '<' type_parameters '>'
150+
: '<' type_parameters '>'
151151
;
152152
153153
type_parameters
154-
: attributes? type_parameter
155-
| type_parameters ',' attributes? type_parameter
156-
;
154+
: attributes? type_parameter
155+
| type_parameters ',' attributes? type_parameter
156+
;
157157
```
158158
159159
*type_parameter* is defined in [§8.5](types.md#85-type-parameters).
@@ -170,14 +170,14 @@ A class declaration may include a *class_base* specification, which defines the
170170

171171
```ANTLR
172172
class_base
173-
: ':' class_type
174-
| ':' interface_type_list
175-
| ':' class_type ',' interface_type_list
176-
;
173+
: ':' class_type
174+
| ':' interface_type_list
175+
| ':' class_type ',' interface_type_list
176+
;
177177
178178
interface_type_list
179-
: interface_type (',' interface_type)*
180-
;
179+
: interface_type (',' interface_type)*
180+
;
181181
```
182182

183183
#### 14.2.4.2 Base classes
@@ -638,8 +638,8 @@ The *class_body* of a class defines the members of that class.
638638
639639
```ANTLR
640640
class_body
641-
: '{' class_member_declaration* '}'
642-
;
641+
: '{' class_member_declaration* '}'
642+
;
643643
```
644644
645645
### 14.2.7 Partial declarations
@@ -3065,9 +3065,9 @@ The *accessor_declarations* of a property specify the executable statements asso
30653065

30663066
```ANTLR
30673067
accessor_declarations
3068-
: get_accessor_declaration set_accessor_declaration?
3069-
| set_accessor_declaration get_accessor_declaration?
3070-
;
3068+
: get_accessor_declaration set_accessor_declaration?
3069+
| set_accessor_declaration get_accessor_declaration?
3070+
;
30713071
30723072
get_accessor_declaration
30733073
: attributes? accessor_modifier? 'get' accessor_body
@@ -3620,38 +3620,38 @@ Events are declared using *event_declaration*s:
36203620
36213621
```ANTLR
36223622
event_declaration
3623-
: attributes? event_modifier* 'event' type variable_declarators ';'
3624-
| attributes? event_modifier* 'event' type member_name
3625-
'{' event_accessor_declarations '}'
3626-
;
3623+
: attributes? event_modifier* 'event' type variable_declarators ';'
3624+
| attributes? event_modifier* 'event' type member_name
3625+
'{' event_accessor_declarations '}'
3626+
;
36273627
36283628
event_modifier
3629-
: 'new'
3630-
| 'public'
3631-
| 'protected'
3632-
| 'internal'
3633-
| 'private'
3634-
| 'static'
3635-
| 'virtual'
3636-
| 'sealed'
3637-
| 'override'
3638-
| 'abstract'
3639-
| 'extern'
3640-
| unsafe_modifier // unsafe code support
3641-
;
3629+
: 'new'
3630+
| 'public'
3631+
| 'protected'
3632+
| 'internal'
3633+
| 'private'
3634+
| 'static'
3635+
| 'virtual'
3636+
| 'sealed'
3637+
| 'override'
3638+
| 'abstract'
3639+
| 'extern'
3640+
| unsafe_modifier // unsafe code support
3641+
;
36423642
36433643
event_accessor_declarations
3644-
: add_accessor_declaration remove_accessor_declaration
3645-
| remove_accessor_declaration add_accessor_declaration
3646-
;
3644+
: add_accessor_declaration remove_accessor_declaration
3645+
| remove_accessor_declaration add_accessor_declaration
3646+
;
36473647
36483648
add_accessor_declaration
3649-
: attributes? 'add' block
3650-
;
3649+
: attributes? 'add' block
3650+
;
36513651
36523652
remove_accessor_declaration
3653-
: attributes? 'remove' block
3654-
;
3653+
: attributes? 'remove' block
3654+
;
36553655
```
36563656
36573657
*unsafe_modifier* ([§22.2](unsafe-code.md#222-unsafe-contexts)) is only available in unsafe code ([§22](unsafe-code.md#22-unsafe-code)).
@@ -3899,23 +3899,23 @@ indexer_declaration
38993899
;
39003900
39013901
indexer_modifier
3902-
: 'new'
3903-
| 'public'
3904-
| 'protected'
3905-
| 'internal'
3906-
| 'private'
3907-
| 'virtual'
3908-
| 'sealed'
3909-
| 'override'
3910-
| 'abstract'
3911-
| 'extern'
3912-
| unsafe_modifier // unsafe code support
3913-
;
3902+
: 'new'
3903+
| 'public'
3904+
| 'protected'
3905+
| 'internal'
3906+
| 'private'
3907+
| 'virtual'
3908+
| 'sealed'
3909+
| 'override'
3910+
| 'abstract'
3911+
| 'extern'
3912+
| unsafe_modifier // unsafe code support
3913+
;
39143914
39153915
indexer_declarator
3916-
: type 'this' '[' formal_parameter_list ']'
3917-
| type interface_type '.' 'this' '[' formal_parameter_list ']'
3918-
;
3916+
: type 'this' '[' formal_parameter_list ']'
3917+
| type interface_type '.' 'this' '[' formal_parameter_list ']'
3918+
;
39193919
39203920
indexer_body
39213921
: '{' accessor_declarations '}'
@@ -4115,51 +4115,50 @@ An ***operator*** is a member that defines the meaning of an expression operator
41154115
41164116
```ANTLR
41174117
operator_declaration
4118-
: attributes? operator_modifier+ operator_declarator operator_body
4119-
;
4118+
: attributes? operator_modifier+ operator_declarator operator_body
4119+
;
41204120
41214121
operator_modifier
4122-
: 'public'
4123-
| 'static'
4124-
| 'extern'
4125-
| unsafe_modifier // unsafe code support
4126-
;
4122+
: 'public'
4123+
| 'static'
4124+
| 'extern'
4125+
| unsafe_modifier // unsafe code support
4126+
;
41274127
41284128
operator_declarator
4129-
: unary_operator_declarator
4130-
| binary_operator_declarator
4131-
| conversion_operator_declarator
4132-
;
4129+
: unary_operator_declarator
4130+
| binary_operator_declarator
4131+
| conversion_operator_declarator
4132+
;
41334133
41344134
unary_operator_declarator
4135-
: type 'operator' overloadable_unary_operator '(' fixed_parameter ')'
4136-
;
4135+
: type 'operator' overloadable_unary_operator '(' fixed_parameter ')'
4136+
;
41374137
41384138
overloadable_unary_operator
4139-
: '+' | '-' | '!' | '~' | '++' | '--' | 'true' | 'false'
4140-
;
4139+
: '+' | '-' | '!' | '~' | '++' | '--' | 'true' | 'false'
4140+
;
41414141
41424142
binary_operator_declarator
4143-
: type 'operator' overloadable_binary_operator
4144-
'(' fixed_parameter ',' fixed_parameter ')'
4145-
;
4143+
: type 'operator' overloadable_binary_operator
4144+
'(' fixed_parameter ',' fixed_parameter ')'
4145+
;
41464146
41474147
overloadable_binary_operator
4148-
: '+' | '-' | '*' | '/' | '%' | '&' | '|' | '^' | '<<'
4149-
| right_shift | '==' | '!=' | '>' | '<' | '>=' | '<='
4150-
;
4148+
: '+' | '-' | '*' | '/' | '%' | '&' | '|' | '^' | '<<'
4149+
| right_shift | '==' | '!=' | '>' | '<' | '>=' | '<='
4150+
;
41514151
41524152
conversion_operator_declarator
4153-
: 'implicit' 'operator' type '(' fixed_parameter ')'
4154-
| 'explicit' 'operator' type '(' fixed_parameter ')'
4155-
;
4153+
: 'implicit' 'operator' type '(' fixed_parameter ')'
4154+
| 'explicit' 'operator' type '(' fixed_parameter ')'
4155+
;
41564156
41574157
operator_body
4158-
: block
4159-
| '=>' expression ';'
4160-
| ';'
4161-
;
4162-
4158+
: block
4159+
| '=>' expression ';'
4160+
| ';'
4161+
;
41634162
```
41644163
41654164
*unsafe_modifier* ([§22.2](unsafe-code.md#222-unsafe-contexts)) is only available in unsafe code ([§22](unsafe-code.md#22-unsafe-code)).
@@ -4384,31 +4383,31 @@ An ***instance constructor*** is a member that implements the actions required t
43844383
43854384
```ANTLR
43864385
constructor_declaration
4387-
: attributes? constructor_modifier* constructor_declarator constructor_body
4388-
;
4386+
: attributes? constructor_modifier* constructor_declarator constructor_body
4387+
;
43894388
43904389
constructor_modifier
4391-
: 'public'
4392-
| 'protected'
4393-
| 'internal'
4394-
| 'private'
4395-
| 'extern'
4396-
| unsafe_modifier // unsafe code support
4397-
;
4390+
: 'public'
4391+
| 'protected'
4392+
| 'internal'
4393+
| 'private'
4394+
| 'extern'
4395+
| unsafe_modifier // unsafe code support
4396+
;
43984397
43994398
constructor_declarator
4400-
: identifier '(' formal_parameter_list? ')' constructor_initializer?
4401-
;
4399+
: identifier '(' formal_parameter_list? ')' constructor_initializer?
4400+
;
44024401
44034402
constructor_initializer
4404-
: ':' 'base' '(' argument_list? ')'
4405-
| ':' 'this' '(' argument_list? ')'
4406-
;
4403+
: ':' 'base' '(' argument_list? ')'
4404+
| ':' 'this' '(' argument_list? ')'
4405+
;
44074406
44084407
constructor_body
4409-
: block
4410-
| ';'
4411-
;
4408+
: block
4409+
| ';'
4410+
;
44124411
```
44134412
44144413
*unsafe_modifier* ([§22.2](unsafe-code.md#222-unsafe-contexts)) is only available in unsafe code ([§22](unsafe-code.md#22-unsafe-code)).
@@ -4653,24 +4652,24 @@ A ***static constructor*** is a member that implements the actions required to i
46534652
46544653
```ANTLR
46554654
static_constructor_declaration
4656-
: attributes? static_constructor_modifiers identifier '(' ')'
4657-
static_constructor_body
4658-
;
4655+
: attributes? static_constructor_modifiers identifier '(' ')'
4656+
static_constructor_body
4657+
;
46594658
46604659
static_constructor_modifiers
4661-
: 'static'
4662-
| 'static' 'extern' unsafe_modifier?
4663-
| 'static' unsafe_modifier 'extern'?
4664-
| 'extern' 'static' unsafe_modifier?
4665-
| 'extern' unsafe_modifier 'static'
4666-
| unsafe_modifier 'static' 'extern'?
4667-
| unsafe_modifier 'extern' 'static'
4668-
;
4660+
: 'static'
4661+
| 'static' 'extern' unsafe_modifier?
4662+
| 'static' unsafe_modifier 'extern'?
4663+
| 'extern' 'static' unsafe_modifier?
4664+
| 'extern' unsafe_modifier 'static'
4665+
| unsafe_modifier 'static' 'extern'?
4666+
| unsafe_modifier 'extern' 'static'
4667+
;
46694668
46704669
static_constructor_body
4671-
: block
4672-
| ';'
4673-
;
4670+
: block
4671+
| ';'
4672+
;
46744673
```
46754674
46764675
*unsafe_modifier* ([§22.2](unsafe-code.md#222-unsafe-contexts)) is only available in unsafe code ([§22](unsafe-code.md#22-unsafe-code)).

standard/expressions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2680,8 +2680,8 @@ The `sizeof` operator returns the number of 8-bit bytes occupied by a variable o
26802680
26812681
```ANTLR
26822682
sizeof_expression
2683-
: 'sizeof' '(' unmanaged_type ')'
2684-
;
2683+
: 'sizeof' '(' unmanaged_type ')'
2684+
;
26852685
```
26862686
26872687
For certain predefined types the `sizeof` operator yields a constant `int` value as shown in the table below:

0 commit comments

Comments
 (0)