using System.Collections.Generic; using Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax; namespace Microsoft.CodeAnalysis.CSharp.Syntax; public sealed class WhileStatementSyntax : StatementSyntax { private SyntaxNode? attributeLists; private ExpressionSyntax? condition; private StatementSyntax? statement; public override SyntaxList AttributeLists => new SyntaxList(((SyntaxNode)this).GetRed(ref attributeLists, 0)); public SyntaxToken WhileKeyword => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.WhileStatementSyntax)(object)((SyntaxNode)this).Green).whileKeyword, ((SyntaxNode)this).GetChildPosition(1), ((SyntaxNode)this).GetChildIndex(1)); public SyntaxToken OpenParenToken => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.WhileStatementSyntax)(object)((SyntaxNode)this).Green).openParenToken, ((SyntaxNode)this).GetChildPosition(2), ((SyntaxNode)this).GetChildIndex(2)); public ExpressionSyntax Condition => ((SyntaxNode)this).GetRed(ref condition, 3); public SyntaxToken CloseParenToken => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.WhileStatementSyntax)(object)((SyntaxNode)this).Green).closeParenToken, ((SyntaxNode)this).GetChildPosition(4), ((SyntaxNode)this).GetChildIndex(4)); public StatementSyntax Statement => ((SyntaxNode)this).GetRed(ref statement, 5); public WhileStatementSyntax Update(SyntaxToken whileKeyword, SyntaxToken openParenToken, ExpressionSyntax condition, SyntaxToken closeParenToken, StatementSyntax statement) { //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_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) return Update(AttributeLists, whileKeyword, openParenToken, condition, closeParenToken, statement); } internal WhileStatementSyntax(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), 3 => ((SyntaxNode)this).GetRed(ref condition, 3), 5 => ((SyntaxNode)this).GetRed(ref statement, 5), _ => null, }); } internal override SyntaxNode? GetCachedSlot(int index) { return (SyntaxNode?)(index switch { 0 => attributeLists, 3 => condition, 5 => statement, _ => null, }); } public override void Accept(CSharpSyntaxVisitor visitor) { visitor.VisitWhileStatement(this); } public override TResult? Accept(CSharpSyntaxVisitor visitor) { return visitor.VisitWhileStatement(this); } public WhileStatementSyntax Update(SyntaxList attributeLists, SyntaxToken whileKeyword, SyntaxToken openParenToken, ExpressionSyntax condition, SyntaxToken closeParenToken, StatementSyntax statement) { //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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) if (attributeLists != AttributeLists || whileKeyword != WhileKeyword || openParenToken != OpenParenToken || condition != Condition || closeParenToken != CloseParenToken || statement != Statement) { WhileStatementSyntax whileStatementSyntax = SyntaxFactory.WhileStatement(attributeLists, whileKeyword, openParenToken, condition, closeParenToken, statement); SyntaxAnnotation[] annotations = ((SyntaxNode)this).GetAnnotations(); if (annotations == null || annotations.Length == 0) { return whileStatementSyntax; } return whileStatementSyntax.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 WhileStatementSyntax WithAttributeLists(SyntaxList attributeLists) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: 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) //IL_0015: Unknown result type (might be due to invalid IL or missing references) return Update(attributeLists, WhileKeyword, OpenParenToken, Condition, CloseParenToken, Statement); } public WhileStatementSyntax WithWhileKeyword(SyntaxToken whileKeyword) { //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_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) return Update(AttributeLists, whileKeyword, OpenParenToken, Condition, CloseParenToken, Statement); } public WhileStatementSyntax WithOpenParenToken(SyntaxToken openParenToken) { //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) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) return Update(AttributeLists, WhileKeyword, openParenToken, Condition, CloseParenToken, Statement); } public WhileStatementSyntax WithCondition(ExpressionSyntax condition) { //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) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) return Update(AttributeLists, WhileKeyword, OpenParenToken, condition, CloseParenToken, Statement); } public WhileStatementSyntax WithCloseParenToken(SyntaxToken closeParenToken) { //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) //IL_000e: 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) return Update(AttributeLists, WhileKeyword, OpenParenToken, Condition, closeParenToken, Statement); } public WhileStatementSyntax WithStatement(StatementSyntax statement) { //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) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) return Update(AttributeLists, WhileKeyword, OpenParenToken, Condition, CloseParenToken, statement); } internal override StatementSyntax AddAttributeListsCore(params AttributeListSyntax[] items) { return AddAttributeLists(items); } public new WhileStatementSyntax 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)); } }