104 lines
3.6 KiB
C#
104 lines
3.6 KiB
C#
using System.Collections.Generic;
|
|
using Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax;
|
|
|
|
namespace Microsoft.CodeAnalysis.CSharp.Syntax;
|
|
|
|
public sealed class BaseListSyntax : CSharpSyntaxNode
|
|
{
|
|
private SyntaxNode? types;
|
|
|
|
public SyntaxToken ColonToken => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.BaseListSyntax)(object)((SyntaxNode)this).Green).colonToken, ((SyntaxNode)this).Position, 0);
|
|
|
|
public SeparatedSyntaxList<BaseTypeSyntax> Types
|
|
{
|
|
get
|
|
{
|
|
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
|
|
//IL_0013: 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)
|
|
SyntaxNode red = ((SyntaxNode)this).GetRed(ref types, 1);
|
|
if (red == null)
|
|
{
|
|
return default(SeparatedSyntaxList<BaseTypeSyntax>);
|
|
}
|
|
return new SeparatedSyntaxList<BaseTypeSyntax>(red, ((SyntaxNode)this).GetChildIndex(1));
|
|
}
|
|
}
|
|
|
|
internal BaseListSyntax(Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.CSharpSyntaxNode green, SyntaxNode? parent, int position)
|
|
: base((GreenNode)(object)green, parent, position)
|
|
{
|
|
}
|
|
|
|
internal override SyntaxNode? GetNodeSlot(int index)
|
|
{
|
|
if (index != 1)
|
|
{
|
|
return null;
|
|
}
|
|
return ((SyntaxNode)this).GetRed(ref types, 1);
|
|
}
|
|
|
|
internal override SyntaxNode? GetCachedSlot(int index)
|
|
{
|
|
if (index != 1)
|
|
{
|
|
return null;
|
|
}
|
|
return types;
|
|
}
|
|
|
|
public override void Accept(CSharpSyntaxVisitor visitor)
|
|
{
|
|
visitor.VisitBaseList(this);
|
|
}
|
|
|
|
public override TResult? Accept<TResult>(CSharpSyntaxVisitor<TResult> visitor)
|
|
{
|
|
return visitor.VisitBaseList(this);
|
|
}
|
|
|
|
public BaseListSyntax Update(SyntaxToken colonToken, SeparatedSyntaxList<BaseTypeSyntax> types)
|
|
{
|
|
//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_001c: Unknown result type (might be due to invalid IL or missing references)
|
|
//IL_001d: 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)
|
|
if (colonToken != ColonToken || types != Types)
|
|
{
|
|
BaseListSyntax baseListSyntax = SyntaxFactory.BaseList(colonToken, types);
|
|
SyntaxAnnotation[] annotations = ((SyntaxNode)this).GetAnnotations();
|
|
if (annotations == null || annotations.Length == 0)
|
|
{
|
|
return baseListSyntax;
|
|
}
|
|
return baseListSyntax.WithAnnotations(annotations);
|
|
}
|
|
return this;
|
|
}
|
|
|
|
public BaseListSyntax WithColonToken(SyntaxToken colonToken)
|
|
{
|
|
//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)
|
|
return Update(colonToken, Types);
|
|
}
|
|
|
|
public BaseListSyntax WithTypes(SeparatedSyntaxList<BaseTypeSyntax> types)
|
|
{
|
|
//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)
|
|
return Update(ColonToken, types);
|
|
}
|
|
|
|
public BaseListSyntax AddTypes(params BaseTypeSyntax[] 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 WithTypes(Types.AddRange((IEnumerable<BaseTypeSyntax>)items));
|
|
}
|
|
}
|