138 lines
6.2 KiB
C#
138 lines
6.2 KiB
C#
using System.Collections.Generic;
|
|||
|
|
using Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax;
|
||
|
|
|
||
|
|
namespace Microsoft.CodeAnalysis.CSharp.Syntax;
|
||
|
|
|
||
|
|
public sealed class LabeledStatementSyntax : StatementSyntax
|
||
|
|
{
|
||
|
|
private SyntaxNode? attributeLists;
|
||
|
|
|
||
|
|
private StatementSyntax? statement;
|
||
|
|
|
||
|
|
public override SyntaxList<AttributeListSyntax> AttributeLists => new SyntaxList<AttributeListSyntax>(((SyntaxNode)this).GetRed(ref attributeLists, 0));
|
||
|
|
|
||
|
|
public SyntaxToken Identifier => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LabeledStatementSyntax)(object)((SyntaxNode)this).Green).identifier, ((SyntaxNode)this).GetChildPosition(1), ((SyntaxNode)this).GetChildIndex(1));
|
||
|
|
|
||
|
|
public SyntaxToken ColonToken => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LabeledStatementSyntax)(object)((SyntaxNode)this).Green).colonToken, ((SyntaxNode)this).GetChildPosition(2), ((SyntaxNode)this).GetChildIndex(2));
|
||
|
|
|
||
|
|
public StatementSyntax Statement => ((SyntaxNode)this).GetRed<StatementSyntax>(ref statement, 3);
|
||
|
|
|
||
|
|
public LabeledStatementSyntax Update(SyntaxToken identifier, SyntaxToken colonToken, 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)
|
||
|
|
return Update(AttributeLists, identifier, colonToken, statement);
|
||
|
|
}
|
||
|
|
|
||
|
|
internal LabeledStatementSyntax(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<StatementSyntax>(ref statement, 3),
|
||
|
|
_ => null,
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
internal override SyntaxNode? GetCachedSlot(int index)
|
||
|
|
{
|
||
|
|
return (SyntaxNode?)(index switch
|
||
|
|
{
|
||
|
|
0 => attributeLists,
|
||
|
|
3 => statement,
|
||
|
|
_ => null,
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
public override void Accept(CSharpSyntaxVisitor visitor)
|
||
|
|
{
|
||
|
|
visitor.VisitLabeledStatement(this);
|
||
|
|
}
|
||
|
|
|
||
|
|
public override TResult? Accept<TResult>(CSharpSyntaxVisitor<TResult> visitor)
|
||
|
|
{
|
||
|
|
return visitor.VisitLabeledStatement(this);
|
||
|
|
}
|
||
|
|
|
||
|
|
public LabeledStatementSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxToken identifier, SyntaxToken colonToken, 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_0034: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0036: 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)
|
||
|
|
if (attributeLists != AttributeLists || identifier != Identifier || colonToken != ColonToken || statement != Statement)
|
||
|
|
{
|
||
|
|
LabeledStatementSyntax labeledStatementSyntax = SyntaxFactory.LabeledStatement(attributeLists, identifier, colonToken, statement);
|
||
|
|
SyntaxAnnotation[] annotations = ((SyntaxNode)this).GetAnnotations();
|
||
|
|
if (annotations == null || annotations.Length == 0)
|
||
|
|
{
|
||
|
|
return labeledStatementSyntax;
|
||
|
|
}
|
||
|
|
return labeledStatementSyntax.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 LabeledStatementSyntax 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)
|
||
|
|
return Update(attributeLists, Identifier, ColonToken, Statement);
|
||
|
|
}
|
||
|
|
|
||
|
|
public LabeledStatementSyntax WithIdentifier(SyntaxToken identifier)
|
||
|
|
{
|
||
|
|
//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)
|
||
|
|
return Update(AttributeLists, identifier, ColonToken, Statement);
|
||
|
|
}
|
||
|
|
|
||
|
|
public LabeledStatementSyntax WithColonToken(SyntaxToken colonToken)
|
||
|
|
{
|
||
|
|
//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)
|
||
|
|
return Update(AttributeLists, Identifier, colonToken, Statement);
|
||
|
|
}
|
||
|
|
|
||
|
|
public LabeledStatementSyntax 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)
|
||
|
|
return Update(AttributeLists, Identifier, ColonToken, statement);
|
||
|
|
}
|
||
|
|
|
||
|
|
internal override StatementSyntax AddAttributeListsCore(params AttributeListSyntax[] items)
|
||
|
|
{
|
||
|
|
return AddAttributeLists(items);
|
||
|
|
}
|
||
|
|
|
||
|
|
public new LabeledStatementSyntax 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));
|
||
|
|
}
|
||
|
|
}
|