-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Expand file tree
/
Copy pathAnonymousFunctionExpressionSyntax.cs
More file actions
27 lines (22 loc) · 1.13 KB
/
AnonymousFunctionExpressionSyntax.cs
File metadata and controls
27 lines (22 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace Microsoft.CodeAnalysis.CSharp.Syntax
{
public partial class AnonymousFunctionExpressionSyntax
{
/// <summary>
/// Either the <see cref="Block"/> if it is not <c>null</c> or the
/// <see cref="ExpressionBody"/> otherwise.
/// </summary>
public CSharpSyntaxNode Body => Block ?? (CSharpSyntaxNode)ExpressionBody!;
public AnonymousFunctionExpressionSyntax WithBody(CSharpSyntaxNode body)
=> body is BlockSyntax block
? WithBlock(block).WithExpressionBody(null)
: WithExpressionBody((ExpressionSyntax)body).WithBlock(null);
public abstract SyntaxToken AsyncKeyword { get; }
public AnonymousFunctionExpressionSyntax WithAsyncKeyword(SyntaxToken asyncKeyword)
=> WithAsyncKeywordCore(asyncKeyword);
internal abstract AnonymousFunctionExpressionSyntax WithAsyncKeywordCore(SyntaxToken asyncKeyword);
}
}