-
Notifications
You must be signed in to change notification settings - Fork 4k
/
ExpressionStatementSyntax.cs
30 lines (28 loc) · 1.07 KB
/
ExpressionStatementSyntax.cs
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
28
29
30
// 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.
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
namespace Microsoft.CodeAnalysis.CSharp.Syntax
{
public partial class ExpressionStatementSyntax
{
/// <summary>
/// Returns true if the <see cref="Expression"/> property is allowed by the rules of the
/// language to be an arbitrary expression, not just a statement expression.
/// </summary>
/// <remarks>
/// True if, for example, this expression statement represents the last expression statement
/// of the interactive top-level code.
/// </remarks>
public bool AllowsAnyExpression
{
get
{
var semicolon = SemicolonToken;
return semicolon.IsMissing && !semicolon.ContainsDiagnostics;
}
}
}
}