Files
T
2026-08-27 10:56:38 -06:00

187 lines
9.4 KiB
C#

using System.Collections.Generic;
using Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax;
namespace Microsoft.CodeAnalysis.CSharp.Syntax;
public sealed class IfStatementSyntax : StatementSyntax
{
private SyntaxNode? attributeLists;
private ExpressionSyntax? condition;
private StatementSyntax? statement;
private ElseClauseSyntax? @else;
public override SyntaxList<AttributeListSyntax> AttributeLists => new SyntaxList<AttributeListSyntax>(((SyntaxNode)this).GetRed(ref attributeLists, 0));
public SyntaxToken IfKeyword => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.IfStatementSyntax)(object)((SyntaxNode)this).Green).ifKeyword, ((SyntaxNode)this).GetChildPosition(1), ((SyntaxNode)this).GetChildIndex(1));
public SyntaxToken OpenParenToken => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.IfStatementSyntax)(object)((SyntaxNode)this).Green).openParenToken, ((SyntaxNode)this).GetChildPosition(2), ((SyntaxNode)this).GetChildIndex(2));
public ExpressionSyntax Condition => ((SyntaxNode)this).GetRed<ExpressionSyntax>(ref condition, 3);
public SyntaxToken CloseParenToken => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.IfStatementSyntax)(object)((SyntaxNode)this).Green).closeParenToken, ((SyntaxNode)this).GetChildPosition(4), ((SyntaxNode)this).GetChildIndex(4));
public StatementSyntax Statement => ((SyntaxNode)this).GetRed<StatementSyntax>(ref statement, 5);
public ElseClauseSyntax? Else => ((SyntaxNode)this).GetRed<ElseClauseSyntax>(ref @else, 6);
public IfStatementSyntax Update(SyntaxToken ifKeyword, SyntaxToken openParenToken, ExpressionSyntax condition, SyntaxToken closeParenToken, StatementSyntax statement, ElseClauseSyntax? @else)
{
//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, ifKeyword, openParenToken, condition, closeParenToken, statement, @else);
}
internal IfStatementSyntax(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<ExpressionSyntax>(ref condition, 3),
5 => ((SyntaxNode)this).GetRed<StatementSyntax>(ref statement, 5),
6 => ((SyntaxNode)this).GetRed<ElseClauseSyntax>(ref @else, 6),
_ => null,
});
}
internal override SyntaxNode? GetCachedSlot(int index)
{
return (SyntaxNode?)(index switch
{
0 => attributeLists,
3 => condition,
5 => statement,
6 => @else,
_ => null,
});
}
public override void Accept(CSharpSyntaxVisitor visitor)
{
visitor.VisitIfStatement(this);
}
public override TResult? Accept<TResult>(CSharpSyntaxVisitor<TResult> visitor)
{
return visitor.VisitIfStatement(this);
}
public IfStatementSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxToken ifKeyword, SyntaxToken openParenToken, ExpressionSyntax condition, SyntaxToken closeParenToken, StatementSyntax statement, ElseClauseSyntax? @else)
{
//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_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: 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 || ifKeyword != IfKeyword || openParenToken != OpenParenToken || condition != Condition || closeParenToken != CloseParenToken || statement != Statement || @else != Else)
{
IfStatementSyntax ifStatementSyntax = SyntaxFactory.IfStatement(attributeLists, ifKeyword, openParenToken, condition, closeParenToken, statement, @else);
SyntaxAnnotation[] annotations = ((SyntaxNode)this).GetAnnotations();
if (annotations == null || annotations.Length == 0)
{
return ifStatementSyntax;
}
return ifStatementSyntax.WithAnnotations(annotations);
}
return this;
}
internal override StatementSyntax WithAttributeListsCore(SyntaxList<AttributeListSyntax> attributeLists)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
return WithAttributeLists(attributeLists);
}
public new IfStatementSyntax WithAttributeLists(SyntaxList<AttributeListSyntax> 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, IfKeyword, OpenParenToken, Condition, CloseParenToken, Statement, Else);
}
public IfStatementSyntax WithIfKeyword(SyntaxToken ifKeyword)
{
//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, ifKeyword, OpenParenToken, Condition, CloseParenToken, Statement, Else);
}
public IfStatementSyntax 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, IfKeyword, openParenToken, Condition, CloseParenToken, Statement, Else);
}
public IfStatementSyntax 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, IfKeyword, OpenParenToken, condition, CloseParenToken, Statement, Else);
}
public IfStatementSyntax 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, IfKeyword, OpenParenToken, Condition, closeParenToken, Statement, Else);
}
public IfStatementSyntax 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, IfKeyword, OpenParenToken, Condition, CloseParenToken, statement, Else);
}
public IfStatementSyntax WithElse(ElseClauseSyntax? @else)
{
//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, IfKeyword, OpenParenToken, Condition, CloseParenToken, Statement, @else);
}
internal override StatementSyntax AddAttributeListsCore(params AttributeListSyntax[] items)
{
return AddAttributeLists(items);
}
public new IfStatementSyntax 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<AttributeListSyntax>)items));
}
}