Skip to content

Commit dce002f

Browse files
authored
Format endnote and endexample markers (#534)
* format *end note* The *end note* marker for a note should be at the end of a single paragraph note. If a note spans multiple paragraphs (including notes that contain examples or lists), the *end note* marker should be its own paragraph. * Format *end example* The *end example* marker for a note should be at the end of a single paragraph note. If a note spans multiple paragraphs (including notes that contain examples or lists), the *end example* marker should be its own paragraph. * fix lint warnings. * fix markdown converter issues One example and one note had their final paragraph not included in the block quote. * add link to comment on code change This code change may be wrong. See comment.
1 parent cf5a3d9 commit dce002f

18 files changed

+780
-264
lines changed

standard/arrays.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ Similarly, a single-dimensional array `T[]` also implements the interface `Syste
9292
> }
9393
> ```
9494
>
95-
> The assignment `lst2 = oa1` generates a compile-time error since the conversion from `object[]` to `IList<string>` is an explicit conversion, not implicit. The cast `(IList<string>)oa1` will cause an exception to be thrown at run-time since `oa1` references an `object[]` and not a `string[]`. However the cast (`IList<string>)oa2` will not cause an exception to be thrown since `oa2` references a `string[]`. *end example*
95+
> The assignment `lst2 = oa1` generates a compile-time error since the conversion from `object[]` to `IList<string>` is an explicit conversion, not implicit. The cast `(IList<string>)oa1` will cause an exception to be thrown at run-time since `oa1` references an `object[]` and not a `string[]`. However the cast (`IList<string>)oa2` will not cause an exception to be thrown since `oa2` references a `string[]`.
96+
>
97+
> *end example*
9698
9799
Whenever there is an implicit or explicit reference conversion from `S[]` to `IList<T>`, there is also an explicit reference conversion from `IList<T>` and its base interfaces to `S[]` ([§10.3.5](conversions.md#1035-explicit-reference-conversions)).
98100
@@ -147,7 +149,9 @@ Because of array covariance, assignments to elements of reference type arrays in
147149
> }
148150
> ```
149151
>
150-
> The assignment to `array[i]` in the `Fill` method implicitly includes a run-time check, which ensures that `value` is either a `null` reference or a reference to an object of a type that is compatible with the actual element type of `array`. In `Main`, the first two invocations of `Fill` succeed, but the third invocation causes a `System.ArrayTypeMismatchException` to be thrown upon executing the first assignment to `array[i]`. The exception occurs because a boxed `int` cannot be stored in a `string` array. *end example*
152+
> The assignment to `array[i]` in the `Fill` method implicitly includes a run-time check, which ensures that `value` is either a `null` reference or a reference to an object of a type that is compatible with the actual element type of `array`. In `Main`, the first two invocations of `Fill` succeed, but the third invocation causes a `System.ArrayTypeMismatchException` to be thrown upon executing the first assignment to `array[i]`. The exception occurs because a boxed `int` cannot be stored in a `string` array.
153+
>
154+
> *end example*
151155
152156
Array covariance specifically does not extend to arrays of *value_type*s. For example, no conversion exists that permits an `int[]` to be treated as an `object[]`.
153157
@@ -248,7 +252,9 @@ When an array creation expression includes both explicit dimension lengths and a
248252
> int[] z = new int[3] {0, 1, 2, 3}; // Error, length/initializer mismatch
249253
> ```
250254
>
251-
> Here, the initializer for `y` results in a compile-time error because the dimension length expression is not a constant, and the initializer for `z` results in a compile-time error because the length and the number of elements in the initializer do not agree. *end example*
255+
> Here, the initializer for `y` results in a compile-time error because the dimension length expression is not a constant, and the initializer for `z` results in a compile-time error because the length and the number of elements in the initializer do not agree.
256+
>
257+
> *end example*
252258
<!-- markdownlint-disable MD028 -->
253259
254260
<!-- markdownlint-enable MD028 -->

standard/attributes.md

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ The attribute `AttributeUsage` ([§21.5.2](attributes.md#2152-the-attributeusage
9494
> }
9595
> ```
9696
>
97-
> shows a class declaration with two uses of the `Author` attribute. *end example*
97+
> shows a class declaration with two uses of the `Author` attribute.
98+
>
99+
> *end example*
98100
99101
`AttributeUsage` has another named parameter ([§21.2.3](attributes.md#2123-positional-and-named-parameters)), called `Inherited`, which indicates whether the attribute, when specified on a base class, is also inherited by classes that derive from that base class. If `Inherited` for an attribute class is true, then that attribute is inherited. If `Inherited` for an attribute class is false then that attribute is not inherited. If it is unspecified, its default value is true.
100102
@@ -318,7 +320,7 @@ In all other contexts, inclusion of an *attribute_target_specifier* is permitted
318320
> class Class2 {}
319321
> ```
320322
>
321-
> *end example*.]
323+
> *end example*.
322324
323325
An implementation can accept other *attribute_target*s, the purposes of which are implementation defined. An implementation that does not recognize such an *attribute_target* shall issue a warning and ignore the containing *attribute_section*.
324326
@@ -399,7 +401,9 @@ It is a compile-time error to use a single-use attribute class more than once on
399401
> public class Class1 {}
400402
> ```
401403
>
402-
> results in a compile-time error because it attempts to use `HelpString`, which is a single-use attribute class, more than once on the declaration of `Class1`. *end example*
404+
> results in a compile-time error because it attempts to use `HelpString`, which is a single-use attribute class, more than once on the declaration of `Class1`.
405+
>
406+
> *end example*
403407
404408
An expression `E` is an *attribute_argument_expression* if all of the following statements are true:
405409
@@ -578,7 +582,9 @@ A method decorated with the `Conditional` attribute is a conditional method. Eac
578582
> }
579583
> ```
580584
>
581-
> declares `Eg.M` as a conditional method associated with the two conditional compilation symbols `ALPHA` and `BETA`. *end example*
585+
> declares `Eg.M` as a conditional method associated with the two conditional compilation symbols `ALPHA` and `BETA`.
586+
>
587+
> *end example*
582588
583589
A call to a conditional method is included if one or more of its associated conditional compilation symbols is defined at the point of call, otherwise the call is omitted.
584590
@@ -617,7 +623,9 @@ In addition, a compile-time error occurs if a delegate is created from a conditi
617623
> }
618624
> ```
619625
>
620-
> declares `Class1.M` as a conditional method. `Class2`’s `Test` method calls this method. Since the conditional compilation symbol `DEBUG` is defined, if `Class2.Test` is called, it will call `M`. If the symbol `DEBUG` had not been defined, then `Class2.Test` would not call `Class1.M`. *end example*
626+
> declares `Class1.M` as a conditional method. `Class2`’s `Test` method calls this method. Since the conditional compilation symbol `DEBUG` is defined, if `Class2.Test` is called, it will call `M`. If the symbol `DEBUG` had not been defined, then `Class2.Test` would not call `Class1.M`.
627+
>
628+
> *end example*
621629
622630
It is important to understand that the inclusion or exclusion of a call to a conditional method is controlled by the conditional compilation symbols at the point of the call.
623631
@@ -657,7 +665,9 @@ It is important to understand that the inclusion or exclusion of a call to a con
657665
> }
658666
> ```
659667
>
660-
> the classes `Class2` and `Class3` each contain calls to the conditional method `Class1.F`, which is conditional based on whether or not `DEBUG` is defined. Since this symbol is defined in the context of `Class2` but not `Class3`, the call to `F` in `Class2` is included, while the call to `F` in `Class3` is omitted. *end example*
668+
> the classes `Class2` and `Class3` each contain calls to the conditional method `Class1.F`, which is conditional based on whether or not `DEBUG` is defined. Since this symbol is defined in the context of `Class2` but not `Class3`, the call to `F` in `Class2` is included, while the call to `F` in `Class3` is omitted.
669+
>
670+
> *end example*
661671
662672
The use of conditional methods in an inheritance chain can be confusing. Calls made to a conditional method through `base`, of the form `base.M`, are subject to the normal conditional method call rules.
663673
@@ -699,7 +709,9 @@ The use of conditional methods in an inheritance chain can be confusing. Calls m
699709
> }
700710
> ```
701711
>
702-
> `Class2` includes a call to the `M` defined in its base class. This call is omitted because the base method is conditional based on the presence of the symbol `DEBUG`, which is undefined. Thus, the method writes to the console “`Class2.M executed`” only. Judicious use of *pp_declaration*s can eliminate such problems. *end example*
712+
> `Class2` includes a call to the `M` defined in its base class. This call is omitted because the base method is conditional based on the presence of the symbol `DEBUG`, which is undefined. Thus, the method writes to the console “`Class2.M executed`” only. Judicious use of *pp_declaration*s can eliminate such problems.
713+
>
714+
> *end example*
703715
704716
#### 21.5.3.3 Conditional attribute classes
705717
@@ -716,7 +728,9 @@ An attribute class ([§21.2](attributes.md#212-attribute-classes)) decorated wit
716728
> public class TestAttribute : Attribute {}
717729
> ```
718730
>
719-
> declares `TestAttribute` as a conditional attribute class associated with the conditional compilations symbols `ALPHA` and `BETA`. *end example*
731+
> declares `TestAttribute` as a conditional attribute class associated with the conditional compilations symbols `ALPHA` and `BETA`.
732+
>
733+
> *end example*
720734
721735
Attribute specifications ([§21.3](attributes.md#213-attribute-specification)) of a conditional attribute are included if one or more of its associated conditional compilation symbols is defined at the point of specification, otherwise the attribute specification is omitted.
722736
@@ -743,7 +757,9 @@ It is important to note that the inclusion or exclusion of an attribute specific
743757
> class Class2 {}
744758
> ```
745759
>
746-
> the classes `Class1` and `Class2` are each decorated with attribute `Test`, which is conditional based on whether or not `DEBUG` is defined. Since this symbol is defined in the context of `Class1` but not `Class2`, the specification of the Test attribute on `Class1` is included, while the specification of the `Test` attribute on `Class2` is omitted. *end example*
760+
> the classes `Class1` and `Class2` are each decorated with attribute `Test`, which is conditional based on whether or not `DEBUG` is defined. Since this symbol is defined in the context of `Class1` but not `Class2`, the specification of the Test attribute on `Class1` is included, while the specification of the `Test` attribute on `Class2` is omitted.
761+
>
762+
> *end example*
747763
748764
### 21.5.4 The Obsolete attribute
749765
@@ -775,7 +791,9 @@ If a program uses a type or member that is decorated with the `Obsolete` attribu
775791
> }
776792
> ```
777793
>
778-
> the class `A` is decorated with the `Obsolete` attribute. Each use of `A` in `Main` results in a warning that includes the specified message, “This class is obsolete; use class `B` instead”. *end example*
794+
> the class `A` is decorated with the `Obsolete` attribute. Each use of `A` in `Main` results in a warning that includes the specified message, “This class is obsolete; use class `B` instead”.
795+
>
796+
> *end example*
779797
780798
### 21.5.5 Caller-info attributes
781799
@@ -804,7 +822,9 @@ When an optional parameter is annotated with one of the caller-info attributes,
804822
> }
805823
> ```
806824
>
807-
> A call to `Log()` with no arguments would print the line number and file path of the call, as well as the name of the member within which the call occurred. *end example*
825+
> A call to `Log()` with no arguments would print the line number and file path of the call, as well as the name of the member within which the call occurred.
826+
>
827+
> *end example*
808828
809829
Caller-info attributes can occur on optional parameters anywhere, including in delegate declarations. However, the specific caller-info attributes have restrictions on the types of the parameters they can attribute, so that there will always be an implicit conversion from a substituted value to the parameter type.
810830
@@ -871,4 +891,5 @@ For interoperation with other languages, an indexer may be implemented using ind
871891
> ```
872892
>
873893
> Now, the indexer’s name is `TheItem`.
894+
>
874895
> *end example*

0 commit comments

Comments
 (0)