using System.Collections.Generic; using Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax; namespace Microsoft.CodeAnalysis.CSharp.Syntax; public sealed class ExpressionStatementSyntax : StatementSyntax { private SyntaxNode? attributeLists; private ExpressionSyntax? expression; public bool AllowsAnyExpression { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) SyntaxToken semicolonToken = SemicolonToken; if (((SyntaxToken)(ref semicolonToken)).IsMissing) { return !((SyntaxToken)(ref semicolonToken)).ContainsDiagnostics; } return false; } } public override SyntaxList AttributeLists => new SyntaxList(((SyntaxNode)this).GetRed(ref attributeLists, 0)); public ExpressionSyntax Expression => ((SyntaxNode)this).GetRed(ref expression, 1); public SyntaxToken SemicolonToken => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.ExpressionStatementSyntax)(object)((SyntaxNode)this).Green).semicolonToken, ((SyntaxNode)this).GetChildPosition(2), ((SyntaxNode)this).GetChildIndex(2)); public ExpressionStatementSyntax Update(ExpressionSyntax expression, SyntaxToken semicolonToken) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) return Update(AttributeLists, expression, semicolonToken); } internal ExpressionStatementSyntax(Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.CSharpSyntaxNode green, SyntaxNode? parent, int position) : base(green, parent, position) { } internal override SyntaxNode? GetNodeSlot(int index) { return (SyntaxNode?)(index switch { 0 => ((SyntaxNode)this).GetRedAtZero(ref attributeLists), 1 => ((SyntaxNode)this).GetRed(ref expression, 1), _ => null, }); } internal override SyntaxNode? GetCachedSlot(int index) { return (SyntaxNode?)(index switch { 0 => attributeLists, 1 => expression, _ => null, }); } public override void Accept(CSharpSyntaxVisitor visitor) { visitor.VisitExpressionStatement(this); } public override TResult? Accept(CSharpSyntaxVisitor visitor) { return visitor.VisitExpressionStatement(this); } public ExpressionStatementSyntax Update(SyntaxList attributeLists, ExpressionSyntax expression, SyntaxToken semicolonToken) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (attributeLists != AttributeLists || expression != Expression || semicolonToken != SemicolonToken) { ExpressionStatementSyntax expressionStatementSyntax = SyntaxFactory.ExpressionStatement(attributeLists, expression, semicolonToken); SyntaxAnnotation[] annotations = ((SyntaxNode)this).GetAnnotations(); if (annotations == null || annotations.Length == 0) { return expressionStatementSyntax; } return expressionStatementSyntax.WithAnnotations(annotations); } return this; } internal override StatementSyntax WithAttributeListsCore(SyntaxList attributeLists) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return WithAttributeLists(attributeLists); } public new ExpressionStatementSyntax WithAttributeLists(SyntaxList attributeLists) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) return Update(attributeLists, Expression, SemicolonToken); } public ExpressionStatementSyntax WithExpression(ExpressionSyntax expression) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) return Update(AttributeLists, expression, SemicolonToken); } public ExpressionStatementSyntax WithSemicolonToken(SyntaxToken semicolonToken) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return Update(AttributeLists, Expression, semicolonToken); } internal override StatementSyntax AddAttributeListsCore(params AttributeListSyntax[] items) { return AddAttributeLists(items); } public new ExpressionStatementSyntax AddAttributeLists(params AttributeListSyntax[] items) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) return WithAttributeLists(AttributeLists.AddRange((IEnumerable)items)); } }