@@ -56,7 +56,7 @@ The productions for *simple_name* ([§11.7.4](expressions.md#1174-simple-names))
56
56
57
57
> * Example* : The statement:
58
58
>
59
- > <!-- IncompleteExample : {template:"standalone-lib", name:"GrammarAmbiguities1"} -->
59
+ > <!-- Incomplete$Example : {template:"standalone-lib", name:"GrammarAmbiguities1"} -->
60
60
> ``` csharp
61
61
> F (G <A , B >(7 ));
62
62
> ```
@@ -79,7 +79,7 @@ then the *type_argument_list* is retained as part of the *simple_name*, *member_
79
79
<!-- markdownlint-enable MD028 -->
80
80
> * Example* : The statement:
81
81
>
82
- > <!-- IncompleteExample : {template:"standalone-lib", name:"GrammarAmbiguities2"} -->
82
+ > <!-- Incomplete$Example : {template:"standalone-lib", name:"GrammarAmbiguities2"} -->
83
83
> ``` csharp
84
84
> F (G <A , B >(7 ));
85
85
> ```
@@ -94,14 +94,14 @@ then the *type_argument_list* is retained as part of the *simple_name*, *member_
94
94
>
95
95
> will each be interpreted as a call to `F ` with two arguments . The statement
96
96
>
97
- > < ! -- IncompleteExample : {template : " standalone-lib" , name : " GrammarAmbiguities4" } -- >
97
+ > < ! -- Incomplete $ Example : {template : " standalone-lib" , name : " GrammarAmbiguities4" } -- >
98
98
> ```csharp
99
99
> x = F < A > + y ;
100
100
> ```
101
101
>
102
102
> will be interpreted as a less - than operator , greater - than operator and unary - plus operator , as if the statement had been written `x = (F < A ) > (+ y )`, instead of as a * simple_name * with a * type_argument_list * followed by a binary - plus operator . In the statement
103
103
>
104
- > < ! -- IncompleteExample : {template : " standalone-lib" , name : " GrammarAmbiguities5" } -- >
104
+ > < ! -- Incomplete $ Example : {template : " standalone-lib" , name : " GrammarAmbiguities5" } -- >
105
105
> ```csharp
106
106
> x = y is C <T > && z ;
107
107
> ```
@@ -192,7 +192,7 @@ A ***delimited comment*** begins with the characters `/*` and ends with the cha
192
192
193
193
> * Example* : The example
194
194
>
195
- > <!-- Example: {template:"standalone-console", name:"HelloWorld1", expectedOutput:["hello, world"]} -->
195
+ > <!-- Example: {template:"standalone-console-without-using ", name:"HelloWorld1", expectedOutput:["hello, world"]} -->
196
196
> ``` csharp
197
197
> /* Hello, world program
198
198
> This program writes "hello, world" to the console
@@ -214,7 +214,7 @@ A ***single-line comment*** begins with the characters `//` and extends to the
214
214
215
215
> * Example * : The example
216
216
>
217
- > < ! -- Example : {template : " standalone-console" , name : " HelloWorld2" , expectedOutput : [" hello, world" ]} -- >
217
+ > < ! -- Example : {template : " standalone-console-without-using " , name : " HelloWorld2" , expectedOutput : [" hello, world" ]} -- >
218
218
> ```csharp
219
219
> // Hello, world program
220
220
> // This program writes "hello, world" to the console
@@ -355,7 +355,7 @@ Multiple translations are not performed. For instance, the string literal `"\u00
355
355
<!-- markdownlint-enable MD028 -->
356
356
> * Example* : The example
357
357
>
358
- > <!-- Example: {template:"standalone-lib", name:"UnicodeCharacterEscapeSequences"} -->
358
+ > <!-- Example: {template:"standalone-lib-without-using ", name:"UnicodeCharacterEscapeSequences"} -->
359
359
> ``` csharp
360
360
> class Class1
361
361
> {
@@ -372,7 +372,7 @@ Multiple translations are not performed. For instance, the string literal `"\u00
372
372
>
373
373
> shows several uses of `\u0066 `, which is the escape sequence for the letter “`f `”. The program is equivalent to
374
374
>
375
- > <!-- Example : {template : " standalone-lib" , name : " UnicodeCharacterEscapeSequencesNot" } -- >
375
+ > <!-- Example : {template : " standalone-lib-without-using " , name : " UnicodeCharacterEscapeSequencesNot" } -- >
376
376
> ```csharp
377
377
> class Class1
378
378
> {
@@ -500,7 +500,7 @@ The prefix “`@`” enables the use of keywords as identifiers, which is usefu
500
500
<!-- markdownlint-enable MD028 -->
501
501
> * Example* : The example:
502
502
>
503
- > <!-- Example: {template:"standalone-lib", name:"IdentifierAtPrefix"} -->
503
+ > <!-- Example: {template:"standalone-lib-without-using ", name:"IdentifierAtPrefix"} -->
504
504
> ``` csharp
505
505
> class @class
506
506
> {
@@ -819,6 +819,7 @@ fragment Hexadecimal_Escape_Sequence
819
819
<!-- markdownlint-enable MD028 -->
820
820
> * Note* : The use of the ` \x ` * Hexadecimal_Escape_Sequence* production can be error-prone and hard to read due to the variable number of hexadecimal digits following the ` \x ` . For example, in the code:
821
821
>
822
+ > <!-- Example: {template:"standalone-console-without-using", name:"CharacterLiterals", ignoredWarnings:["CS0219"]} -->
822
823
> ``` csharp
823
824
> string good = " x9Good text" ;
824
825
> string bad = " x9Bad text" ;
@@ -904,7 +905,7 @@ fragment Quote_Escape_Sequence
904
905
905
906
> * Example* : The example
906
907
>
907
- > <!-- Example: {template:"code-in-main", name:"StringLiterals", ignoredWarnings:["CS0219"]} -->
908
+ > <!-- Example: {template:"code-in-main-without-using ", name:"StringLiterals", ignoredWarnings:["CS0219"]} -->
908
909
> ``` csharp
909
910
> string a = " Happy birthday, Joel" ; // Happy birthday, Joel
910
911
> string b = @" Happy birthday, Joel" ; // Happy birthday, Joel
@@ -938,7 +939,7 @@ Each string literal does not necessarily result in a new string instance. When t
938
939
939
940
> * Example * : For instance , the output produced by
940
941
>
941
- > < ! -- Example : {template : " standalone-console" , name : " ObjectReferenceEquality" , expectedOutput : [" True" ]} -- >
942
+ > < ! -- Example : {template : " standalone-console-without-using " , name : " ObjectReferenceEquality" , expectedOutput : [" True" ]} -- >
942
943
> ```csharp
943
944
> class Test
944
945
> {
@@ -1064,7 +1065,7 @@ Pre-processing directives are not part of the syntactic grammar of C#. However,
1064
1065
1065
1066
> * Example* : When compiled, the program
1066
1067
>
1067
- > <!-- Example: {template:"standalone-lib", name:"PreproGeneral1"} -->
1068
+ > <!-- Example: {template:"standalone-lib-without-using ", name:"PreproGeneral1"} -->
1068
1069
> ``` csharp
1069
1070
> #define A
1070
1071
> #undef B
@@ -1085,7 +1086,7 @@ Pre-processing directives are not part of the syntactic grammar of C#. However,
1085
1086
>
1086
1087
> results in the exact same sequence of tokens as the program
1087
1088
>
1088
- > < ! -- Example : {template : " standalone-lib" , name : " PreproGeneral2" } -- >
1089
+ > < ! -- Example : {template : " standalone-lib-without-using " , name : " PreproGeneral2" } -- >
1089
1090
> ```csharp
1090
1091
> class C
1091
1092
> {
@@ -1179,7 +1180,7 @@ Any `#define` and `#undef` directives in a compilation unit shall occur before t
1179
1180
1180
1181
> * Example* : The example:
1181
1182
>
1182
- > <!-- Example: {template:"standalone-lib", name:"PreproDefinitionDirectives1", replaceEllipsis:true} -->
1183
+ > <!-- Example: {template:"standalone-lib-without-using ", name:"PreproDefinitionDirectives1", replaceEllipsis:true} -->
1183
1184
> ``` csharp
1184
1185
> #define Enterprise
1185
1186
> #if Professional || Enterprise
@@ -1201,7 +1202,7 @@ Any `#define` and `#undef` directives in a compilation unit shall occur before t
1201
1202
<!-- markdownlint -enable MD028 -->
1202
1203
> *Example *: The following example results in a compile - time error because a #define follows real code :
1203
1204
>
1204
- > < ! -- Example : {template : " standalone-lib" , name : " PreproDefinitionDirectives2" , expectedErrors : [" CS1032" ]} -- >
1205
+ > < ! -- Example : {template : " standalone-lib-without-using " , name : " PreproDefinitionDirectives2" , expectedErrors : [" CS1032" ]} -- >
1205
1206
> ```csharp
1206
1207
> #define A
1207
1208
> namespace N
@@ -1219,7 +1220,7 @@ A `#define` may define a conditional compilation symbol that is already defined,
1219
1220
1220
1221
> *Example*: The example below defines a conditional compilation symbol A and then defines it again.
1221
1222
>
1222
- > <!-- Example: {template:"standalone-lib", name:"PreproSymbolRedefinition"} -- >
1223
+ > <!-- Example: {template:"standalone-lib-without-using ", name:"PreproSymbolRedefinition"} -- >
1223
1224
> ```csharp
1224
1225
> #define A
1225
1226
> #define A
@@ -1233,7 +1234,7 @@ A `#undef` may “undefine” a conditional compilation symbol that is not defin
1233
1234
1234
1235
> *Example*: The example below defines a conditional compilation symbol `A` and then undefines it twice; although the second `#undef ` has no effect , it is still valid .
1235
1236
>
1236
- > <!-- Example : {template : " standalone-lib" , name : " PreproSymbolUndef" } -- >
1237
+ > <!-- Example : {template : " standalone-lib-without-using " , name : " PreproSymbolUndef" } -- >
1237
1238
> ```csharp
1238
1239
> #define A
1239
1240
> #undef A
@@ -1289,7 +1290,8 @@ Any remaining conditional sections are skipped and no tokens, except those for p
1289
1290
<!-- markdownlint-enable MD028 -->
1290
1291
> * Example* : The following example illustrates how conditional compilation directives can nest:
1291
1292
>
1292
- > <!-- IncompleteExample: {template:"standalone-lib", name:"PreproConditionalCompilation", replaceEllipsis:true} -->
1293
+ > <!-- FIX: my thinking was to make CheckConsistency, WriteToLog, CommitHelper extension methods, but I could not get that to work. -->
1294
+ > <!-- Incomplete$Example: {template:"standalone-lib-without-using", name:"PreproConditionalCompilation", replaceEllipsis:true} -->
1293
1295
> ``` csharp
1294
1296
> #define Debug // Debugging on
1295
1297
> #undef Trace // Tracing off
@@ -1311,7 +1313,8 @@ Any remaining conditional sections are skipped and no tokens, except those for p
1311
1313
>
1312
1314
> Except for pre-processing directives, skipped source code is not subject to lexical analysis. For example, the following is valid despite the unterminated comment in the `#else` section:
1313
1315
>
1314
- > <!-- IncompleteExample: {template:"standalone-lib", name:"PreproInvalidSkippedSource", replaceEllipsis:true} -- >
1316
+ > <!-- FIX: my thinking was to make CheckConsistency an extension method, but I could not get that to work. -->
1317
+ > <!-- Incomplete$Example: {template:"standalone-lib-without-using", name:"PreproInvalidSkippedSource", replaceEllipsis:true} -- >
1315
1318
> ```csharp
1316
1319
> #define Debug // Debugging on
1317
1320
> class PurchaseTransaction
@@ -1332,7 +1335,7 @@ Any remaining conditional sections are skipped and no tokens, except those for p
1332
1335
>
1333
1336
> Pre-processing directives are not processed when they appear inside multi-line input elements. For example, the program:
1334
1337
>
1335
- > <!-- Example: {template:"standalone-console", name:"PreproDirectivesNotProcessed", inferOutput:true} -->
1338
+ > <!-- Example: {template:"standalone-console-without-using ", name:"PreproDirectivesNotProcessed", inferOutput:true} -->
1336
1339
> ```csharp
1337
1340
> class Hello
1338
1341
> {
@@ -1362,7 +1365,7 @@ Any remaining conditional sections are skipped and no tokens, except those for p
1362
1365
>
1363
1366
> In peculiar cases, the set of pre-processing directives that is processed might depend on the evaluation of the *pp_expression*. The example:
1364
1367
>
1365
- > <!-- Example: {template:"standalone-lib", name:"PreproTokenStream"} -->
1368
+ > <!-- Example: {template:"standalone-lib-without-using ", name:"PreproTokenStream"} -->
1366
1369
> ```csharp
1367
1370
> #if X
1368
1371
> /*
@@ -1392,7 +1395,7 @@ fragment PP_Message
1392
1395
1393
1396
> * Example * : The example
1394
1397
>
1395
- > < ! -- Example : {template : " standalone-lib" , name : " PreproErrorDirective" , replaceEllipsis : true } -- >
1398
+ > < ! -- Example : {template : " standalone-lib-without-using " , name : " PreproErrorDirective" , replaceEllipsis : true } -- >
1396
1399
> ```csharp
1397
1400
> #if Debug && Retail
1398
1401
> #error A build can 't be both debug and retail
@@ -1427,6 +1430,7 @@ No semantic meaning is attached to a region; regions are intended for use by the
1427
1430
1428
1431
The lexical processing of a region :
1429
1432
1433
+ < ! -- Example : {template : " standalone-lib-without-using" , name : " Region1" , replaceEllipsis : true } -- >
1430
1434
```csharp
1431
1435
#region
1432
1436
.. .
@@ -1435,6 +1439,7 @@ The lexical processing of a region:
1435
1439
1436
1440
corresponds exactly to the lexical processing of a conditional compilation directive of the form :
1437
1441
1442
+ < ! -- Example : {template : " standalone-lib-without-using" , name : " Region2" , replaceEllipsis : true } -- >
1438
1443
```csharp
1439
1444
#if true
1440
1445
.. .
0 commit comments