Skip to content

Commit 4146782

Browse files
Update the XML doc comments
1 parent 21def26 commit 4146782

33 files changed

+1382
-1538
lines changed

Matchmaker/AsyncMatch.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,8 @@ public static AsyncMatch<TInput> Create<TInput>(bool fallthroughByDefault) =>
6666
/// <returns>The globally cached match expression.</returns>
6767
/// <remarks>
6868
/// <para>
69-
/// The key of the cache is the location of this method's call in the source code.
70-
/// This way, a new match expression object will not be allocated every time pattern matching occurs
71-
/// in the same place more than once.
69+
/// The key of the cache is the location of this method's call in the source code. This way, a new match expression
70+
/// object will not be allocated every time pattern matching occurs in the same place more than once.
7271
/// </para>
7372
/// <para>
7473
/// The pattern caching process is thread-safe.
@@ -112,9 +111,8 @@ public static AsyncMatch<TInput, TOutput> CreateStatic<TInput, TOutput>(
112111
/// <returns>The globally cached match expression.</returns>
113112
/// <remarks>
114113
/// <para>
115-
/// The key of the cache is the location of this method's call in the source code.
116-
/// This way, a new match statement object will not be allocated every time pattern matching occurs
117-
/// in the same place more than once.
114+
/// The key of the cache is the location of this method's call in the source code. This way, a new match expression
115+
/// object will not be allocated every time pattern matching occurs in the same place more than once.
118116
/// </para>
119117
/// <para>
120118
/// The pattern caching process is thread-safe.
@@ -155,7 +153,7 @@ public static AsyncMatch<TInput> CreateStatic<TInput>(
155153
/// <typeparam name="TOutput">The type of the result.</typeparam>
156154
/// <remarks>
157155
/// <para>
158-
/// After calling this method all
156+
/// After calling this method, all
159157
/// <see cref="CreateStatic{TInput, TOutput}(Action{AsyncMatchBuilder{TInput, TOutput}}, string, int)" />
160158
/// calls will recalculate match expressions for types <typeparamref name="TInput" /> and
161159
/// <typeparamref name="TOutput" />.
@@ -173,7 +171,7 @@ public static void ClearCache<TInput, TOutput>() =>
173171
/// <typeparam name="TInput">The type of the input value.</typeparam>
174172
/// <remarks>
175173
/// <para>
176-
/// After calling this method all
174+
/// After calling this method, all
177175
/// <see cref="CreateStatic{TInput}(Action{AsyncMatchBuilder{TInput}}, string, int)" />
178176
/// calls will recalculate match statements for type <typeparamref name="TInput" />.
179177
/// </para>

Matchmaker/AsyncMatch_1.cs

Lines changed: 51 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ private AsyncMatch(IReadOnlyCollection<CaseData> cases, bool fallthroughByDefaul
5858
internal static ConcurrentDictionary<string, AsyncMatch<TInput>> Cache { get; } = new();
5959

6060
/// <summary>
61-
/// Returns a new match statement which includes the specified pattern and action to execute if this
62-
/// pattern is matched successfully.
61+
/// Returns a new match statement which includes the specified pattern and action to execute if this pattern is
62+
/// matched successfully.
6363
/// </summary>
6464
/// <typeparam name="TMatchResult">The type of the result of the pattern's match.</typeparam>
6565
/// <param name="pattern">The pattern to match with.</param>
6666
/// <param name="action">The action to execute if the match is successful.</param>
6767
/// <returns>
68-
/// A new match statement which includes the specified pattern and action to execute if this
69-
/// pattern is matched successfully.
68+
/// A new match statement which includes the specified pattern and action to execute if this pattern is matched
69+
/// successfully.
7070
/// </returns>
7171
/// <exception cref="ArgumentNullException">
7272
/// <paramref name="pattern" /> or <paramref name="action" /> is <see langword="null" />.
@@ -77,15 +77,15 @@ public AsyncMatch<TInput> Case<TMatchResult>(
7777
this.Case(pattern, this.fallthroughByDefault, action);
7878

7979
/// <summary>
80-
/// Returns a new match statement which includes the specified pattern and action to execute if this
81-
/// pattern is matched successfully.
80+
/// Returns a new match statement which includes the specified pattern and action to execute if this pattern is
81+
/// matched successfully.
8282
/// </summary>
8383
/// <typeparam name="TMatchResult">The type of the result of the pattern's match.</typeparam>
8484
/// <param name="pattern">The pattern to match with.</param>
8585
/// <param name="action">The action to execute if the match is successful.</param>
8686
/// <returns>
87-
/// A new match statement which includes the specified pattern and action to execute if this
88-
/// pattern is matched successfully.
87+
/// A new match statement which includes the specified pattern and action to execute if this pattern is matched
88+
/// successfully.
8989
/// </returns>
9090
/// <exception cref="ArgumentNullException">
9191
/// <paramref name="pattern" /> or <paramref name="action" /> is <see langword="null" />.
@@ -96,15 +96,15 @@ public AsyncMatch<TInput> Case<TMatchResult>(
9696
this.Case(pattern, this.fallthroughByDefault, action.AsAsync());
9797

9898
/// <summary>
99-
/// Returns a new match statement which includes the specified pattern and action to execute if this
100-
/// pattern is matched successfully.
99+
/// Returns a new match statement which includes the specified pattern and action to execute if this pattern is
100+
/// matched successfully.
101101
/// </summary>
102102
/// <typeparam name="TMatchResult">The type of the result of the pattern's match.</typeparam>
103103
/// <param name="pattern">The pattern to match with.</param>
104104
/// <param name="action">The action to execute if the match is successful.</param>
105105
/// <returns>
106-
/// A new match statement which includes the specified pattern and action to execute if this
107-
/// pattern is matched successfully.
106+
/// A new match statement which includes the specified pattern and action to execute if this pattern is matched
107+
/// successfully.
108108
/// </returns>
109109
/// <exception cref="ArgumentNullException">
110110
/// <paramref name="pattern" /> or <paramref name="action" /> is <see langword="null" />.
@@ -115,15 +115,15 @@ public AsyncMatch<TInput> Case<TMatchResult>(
115115
this.Case(pattern.AsAsync(), this.fallthroughByDefault, action);
116116

117117
/// <summary>
118-
/// Returns a new match statement which includes the specified pattern and action to execute if this
119-
/// pattern is matched successfully.
118+
/// Returns a new match statement which includes the specified pattern and action to execute if this pattern is
119+
/// matched successfully.
120120
/// </summary>
121121
/// <typeparam name="TMatchResult">The type of the result of the pattern's match.</typeparam>
122122
/// <param name="pattern">The pattern to match with.</param>
123123
/// <param name="action">The action to execute if the match is successful.</param>
124124
/// <returns>
125-
/// A new match statement which includes the specified pattern and action to execute if this
126-
/// pattern is matched successfully.
125+
/// A new match statement which includes the specified pattern and action to execute if this pattern is matched
126+
/// successfully.
127127
/// </returns>
128128
/// <exception cref="ArgumentNullException">
129129
/// <paramref name="pattern" /> or <paramref name="action" /> is <see langword="null" />.
@@ -134,16 +134,16 @@ public AsyncMatch<TInput> Case<TMatchResult>(
134134
this.Case(pattern.AsAsync(), this.fallthroughByDefault, action.AsAsync());
135135

136136
/// <summary>
137-
/// Returns a new match statement which includes the specified pattern and action to execute if this
138-
/// pattern is matched successfully.
137+
/// Returns a new match statement which includes the specified pattern and action to execute if this pattern is
138+
/// matched successfully.
139139
/// </summary>
140140
/// <typeparam name="TMatchResult">The type of the result of the pattern's match.</typeparam>
141141
/// <param name="pattern">The pattern to match with.</param>
142142
/// <param name="fallthrough">The fallthrough behaviour.</param>
143143
/// <param name="action">The action to execute if the match is successful.</param>
144144
/// <returns>
145-
/// A new match statement which includes the specified pattern and action to execute if this
146-
/// pattern is matched successfully.
145+
/// A new match statement which includes the specified pattern and action to execute if this pattern is matched
146+
/// successfully.
147147
/// </returns>
148148
/// <exception cref="ArgumentNullException">
149149
/// <paramref name="pattern" /> or <paramref name="action" /> is <see langword="null" />.
@@ -167,16 +167,16 @@ public AsyncMatch<TInput> Case<TMatchResult>(
167167
: throw new ArgumentNullException(nameof(pattern));
168168

169169
/// <summary>
170-
/// Returns a new match statement which includes the specified pattern and action to execute if this
171-
/// pattern is matched successfully.
170+
/// Returns a new match statement which includes the specified pattern and action to execute if this pattern is
171+
/// matched successfully.
172172
/// </summary>
173173
/// <typeparam name="TMatchResult">The type of the result of the pattern's match.</typeparam>
174174
/// <param name="pattern">The pattern to match with.</param>
175175
/// <param name="fallthrough">The fallthrough behaviour.</param>
176176
/// <param name="action">The action to execute if the match is successful.</param>
177177
/// <returns>
178-
/// A new match statement which includes the specified pattern and action to execute if this
179-
/// pattern is matched successfully.
178+
/// A new match statement which includes the specified pattern and action to execute if this pattern is matched
179+
/// successfully.
180180
/// </returns>
181181
/// <exception cref="ArgumentNullException">
182182
/// <paramref name="pattern" /> or <paramref name="action" /> is <see langword="null" />.
@@ -188,16 +188,16 @@ public AsyncMatch<TInput> Case<TMatchResult>(
188188
this.Case(pattern, fallthrough, action.AsAsync());
189189

190190
/// <summary>
191-
/// Returns a new match statement which includes the specified pattern and action to execute if this
192-
/// pattern is matched successfully.
191+
/// Returns a new match statement which includes the specified pattern and action to execute if this pattern is
192+
/// matched successfully.
193193
/// </summary>
194194
/// <typeparam name="TMatchResult">The type of the result of the pattern's match.</typeparam>
195195
/// <param name="pattern">The pattern to match with.</param>
196196
/// <param name="fallthrough">The fallthrough behaviour.</param>
197197
/// <param name="action">The action to execute if the match is successful.</param>
198198
/// <returns>
199-
/// A new match statement which includes the specified pattern and action to execute if this
200-
/// pattern is matched successfully.
199+
/// A new match statement which includes the specified pattern and action to execute if this pattern is matched
200+
/// successfully.
201201
/// </returns>
202202
/// <exception cref="ArgumentNullException">
203203
/// <paramref name="pattern" /> or <paramref name="action" /> is <see langword="null" />.
@@ -209,16 +209,16 @@ public AsyncMatch<TInput> Case<TMatchResult>(
209209
this.Case(pattern.AsAsync(), fallthrough, action);
210210

211211
/// <summary>
212-
/// Returns a new match statement which includes the specified pattern and action to execute if this
213-
/// pattern is matched successfully.
212+
/// Returns a new match statement which includes the specified pattern and action to execute if this pattern is
213+
/// matched successfully.
214214
/// </summary>
215215
/// <typeparam name="TMatchResult">The type of the result of the pattern's match.</typeparam>
216216
/// <param name="pattern">The pattern to match with.</param>
217217
/// <param name="fallthrough">The fallthrough behaviour.</param>
218218
/// <param name="action">The action to execute if the match is successful.</param>
219219
/// <returns>
220-
/// A new match statement which includes the specified pattern and action to execute if this
221-
/// pattern is matched successfully.
220+
/// A new match statement which includes the specified pattern and action to execute if this pattern is matched
221+
/// successfully.
222222
/// </returns>
223223
/// <exception cref="ArgumentNullException">
224224
/// <paramref name="pattern" /> or <paramref name="action" /> is <see langword="null" />.
@@ -230,14 +230,14 @@ public AsyncMatch<TInput> Case<TMatchResult>(
230230
this.Case(pattern.AsAsync(), fallthrough, action.AsAsync());
231231

232232
/// <summary>
233-
/// Returns a new match statement which includes the pattern for the specified type
234-
/// and action to execute if this pattern is matched successfully.
233+
/// Returns a new match statement which includes the pattern for the specified type and action to execute if this
234+
/// pattern is matched successfully.
235235
/// </summary>
236236
/// <typeparam name="TType">The type of the result of the pattern's match.</typeparam>
237237
/// <param name="action">The action to execute if the match is successful.</param>
238238
/// <returns>
239-
/// A new match statement which includes the type pattern and action to execute if this
240-
/// pattern is matched successfully.
239+
/// A new match statement which includes the type pattern and action to execute if this pattern is matched
240+
/// successfully.
241241
/// </returns>
242242
/// <remarks>
243243
/// This method is functionally equivalent to the following:
@@ -253,14 +253,14 @@ public AsyncMatch<TInput> Case<TType>(Func<TType, Task> action)
253253
this.Case(this.fallthroughByDefault, action);
254254

255255
/// <summary>
256-
/// Returns a new match statement which includes the pattern for the specified type
257-
/// and action to execute if this pattern is matched successfully.
256+
/// Returns a new match statement which includes the pattern for the specified type and action to execute if this
257+
/// pattern is matched successfully.
258258
/// </summary>
259259
/// <typeparam name="TType">The type of the result of the pattern's match.</typeparam>
260260
/// <param name="action">The action to execute if the match is successful.</param>
261261
/// <returns>
262-
/// A new match statement which includes the type pattern and action to execute if this
263-
/// pattern is matched successfully.
262+
/// A new match statement which includes the type pattern and action to execute if this pattern is matched
263+
/// successfully.
264264
/// </returns>
265265
/// <remarks>
266266
/// This method is functionally equivalent to the following:
@@ -276,15 +276,15 @@ public AsyncMatch<TInput> Case<TType>(Action<TType> action)
276276
this.Case(action.AsAsync());
277277

278278
/// <summary>
279-
/// Returns a new match statement which includes the pattern for the specified type
280-
/// and action to execute if this pattern is matched successfully.
279+
/// Returns a new match statement which includes the pattern for the specified type and action to execute if this
280+
/// pattern is matched successfully.
281281
/// </summary>
282282
/// <typeparam name="TType">The type of the result of the pattern's match.</typeparam>
283283
/// <param name="fallthrough">The fallthrough behaviour.</param>
284284
/// <param name="action">The action to execute if the match is successful.</param>
285285
/// <returns>
286-
/// A new match statement which includes the type pattern and action to execute if this
287-
/// pattern is matched successfully.
286+
/// A new match statement which includes the type pattern and action to execute if this pattern is matched
287+
/// successfully.
288288
/// </returns>
289289
/// <remarks>
290290
/// This method is functionally equivalent to the following:
@@ -300,15 +300,15 @@ public AsyncMatch<TInput> Case<TType>(bool fallthrough, Func<TType, Task> action
300300
this.Case(AsyncPattern.Type<TInput, TType>(), fallthrough, action);
301301

302302
/// <summary>
303-
/// Returns a new match statement which includes the pattern for the specified type
304-
/// and action to execute if this pattern is matched successfully.
303+
/// Returns a new match statement which includes the pattern for the specified type and action to execute if this
304+
/// pattern is matched successfully.
305305
/// </summary>
306306
/// <typeparam name="TType">The type of the result of the pattern's match.</typeparam>
307307
/// <param name="fallthrough">The fallthrough behaviour.</param>
308308
/// <param name="action">The action to execute if the match is successful.</param>
309309
/// <returns>
310-
/// A new match statement which includes the type pattern and action to execute if this
311-
/// pattern is matched successfully.
310+
/// A new match statement which includes the type pattern and action to execute if this pattern is matched
311+
/// successfully.
312312
/// </returns>
313313
/// <remarks>
314314
/// This method is functionally equivalent to the following:
@@ -345,8 +345,7 @@ public async Task ExecuteAsync(TInput input)
345345
/// </summary>
346346
/// <param name="input">The input value of the statement.</param>
347347
/// <returns>
348-
/// <see langword="true" />, if the match was successful.
349-
/// Otherwise, <see langword="false" />.
348+
/// <see langword="true" />, if the match was successful. Otherwise, <see langword="false" />.
350349
/// </returns>
351350
public async Task<bool> ExecuteNonStrictAsync(TInput input)
352351
{
@@ -368,8 +367,8 @@ public async Task<bool> ExecuteNonStrictAsync(TInput input)
368367
/// </summary>
369368
/// <param name="input">The input value of the statement.</param>
370369
/// <returns>
371-
/// An enumerable of <see langword="null" /> objects which enables the execution to be lazy.
372-
/// The number of items in this enumerable equals the number of successful cases.
370+
/// An enumerable of <see langword="null" /> objects which enables the execution to be lazy. The number of items in
371+
/// this enumerable equals the number of successful cases.
373372
/// </returns>
374373
public async IAsyncEnumerable<object?> ExecuteWithFallthroughAsync(TInput input)
375374
{

0 commit comments

Comments
 (0)