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

303 lines
17 KiB
C#

using System.Collections.Generic;
using Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax;
namespace Microsoft.CodeAnalysis.CSharp.Syntax;
public sealed class DelegateDeclarationSyntax : MemberDeclarationSyntax
{
private SyntaxNode? attributeLists;
private TypeSyntax? returnType;
private TypeParameterListSyntax? typeParameterList;
private ParameterListSyntax? parameterList;
private SyntaxNode? constraintClauses;
public int Arity
{
get
{
//IL_000e: 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)
if (TypeParameterList != null)
{
return TypeParameterList.Parameters.Count;
}
return 0;
}
}
public override SyntaxList<AttributeListSyntax> AttributeLists => new SyntaxList<AttributeListSyntax>(((SyntaxNode)this).GetRed(ref attributeLists, 0));
public override SyntaxTokenList Modifiers
{
get
{
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
GreenNode slot = ((SyntaxNode)this).Green.GetSlot(1);
if (slot == null)
{
return default(SyntaxTokenList);
}
return new SyntaxTokenList((SyntaxNode)(object)this, slot, ((SyntaxNode)this).GetChildPosition(1), ((SyntaxNode)this).GetChildIndex(1));
}
}
public SyntaxToken DelegateKeyword => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.DelegateDeclarationSyntax)(object)((SyntaxNode)this).Green).delegateKeyword, ((SyntaxNode)this).GetChildPosition(2), ((SyntaxNode)this).GetChildIndex(2));
public TypeSyntax ReturnType => ((SyntaxNode)this).GetRed<TypeSyntax>(ref returnType, 3);
public SyntaxToken Identifier => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.DelegateDeclarationSyntax)(object)((SyntaxNode)this).Green).identifier, ((SyntaxNode)this).GetChildPosition(4), ((SyntaxNode)this).GetChildIndex(4));
public TypeParameterListSyntax? TypeParameterList => ((SyntaxNode)this).GetRed<TypeParameterListSyntax>(ref typeParameterList, 5);
public ParameterListSyntax ParameterList => ((SyntaxNode)this).GetRed<ParameterListSyntax>(ref parameterList, 6);
public SyntaxList<TypeParameterConstraintClauseSyntax> ConstraintClauses => new SyntaxList<TypeParameterConstraintClauseSyntax>(((SyntaxNode)this).GetRed(ref constraintClauses, 7));
public SyntaxToken SemicolonToken => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.DelegateDeclarationSyntax)(object)((SyntaxNode)this).Green).semicolonToken, ((SyntaxNode)this).GetChildPosition(8), ((SyntaxNode)this).GetChildIndex(8));
internal DelegateDeclarationSyntax(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<TypeSyntax>(ref returnType, 3),
5 => ((SyntaxNode)this).GetRed<TypeParameterListSyntax>(ref typeParameterList, 5),
6 => ((SyntaxNode)this).GetRed<ParameterListSyntax>(ref parameterList, 6),
7 => ((SyntaxNode)this).GetRed(ref constraintClauses, 7),
_ => null,
});
}
internal override SyntaxNode? GetCachedSlot(int index)
{
return (SyntaxNode?)(index switch
{
0 => attributeLists,
3 => returnType,
5 => typeParameterList,
6 => parameterList,
7 => constraintClauses,
_ => null,
});
}
public override void Accept(CSharpSyntaxVisitor visitor)
{
visitor.VisitDelegateDeclaration(this);
}
public override TResult? Accept<TResult>(CSharpSyntaxVisitor<TResult> visitor)
{
return visitor.VisitDelegateDeclaration(this);
}
public DelegateDeclarationSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken delegateKeyword, TypeSyntax returnType, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, 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_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: 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)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
if (attributeLists != AttributeLists || modifiers != Modifiers || delegateKeyword != DelegateKeyword || returnType != ReturnType || identifier != Identifier || typeParameterList != TypeParameterList || parameterList != ParameterList || constraintClauses != ConstraintClauses || semicolonToken != SemicolonToken)
{
DelegateDeclarationSyntax delegateDeclarationSyntax = SyntaxFactory.DelegateDeclaration(attributeLists, modifiers, delegateKeyword, returnType, identifier, typeParameterList, parameterList, constraintClauses, semicolonToken);
SyntaxAnnotation[] annotations = ((SyntaxNode)this).GetAnnotations();
if (annotations == null || annotations.Length == 0)
{
return delegateDeclarationSyntax;
}
return delegateDeclarationSyntax.WithAnnotations(annotations);
}
return this;
}
internal override MemberDeclarationSyntax WithAttributeListsCore(SyntaxList<AttributeListSyntax> attributeLists)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
return WithAttributeLists(attributeLists);
}
public new DelegateDeclarationSyntax 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)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
return Update(attributeLists, Modifiers, DelegateKeyword, ReturnType, Identifier, TypeParameterList, ParameterList, ConstraintClauses, SemicolonToken);
}
internal override MemberDeclarationSyntax WithModifiersCore(SyntaxTokenList modifiers)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
return WithModifiers(modifiers);
}
public new DelegateDeclarationSyntax WithModifiers(SyntaxTokenList modifiers)
{
//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)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
return Update(AttributeLists, modifiers, DelegateKeyword, ReturnType, Identifier, TypeParameterList, ParameterList, ConstraintClauses, SemicolonToken);
}
public DelegateDeclarationSyntax WithDelegateKeyword(SyntaxToken delegateKeyword)
{
//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)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
return Update(AttributeLists, Modifiers, delegateKeyword, ReturnType, Identifier, TypeParameterList, ParameterList, ConstraintClauses, SemicolonToken);
}
public DelegateDeclarationSyntax WithReturnType(TypeSyntax returnType)
{
//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)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
return Update(AttributeLists, Modifiers, DelegateKeyword, returnType, Identifier, TypeParameterList, ParameterList, ConstraintClauses, SemicolonToken);
}
public DelegateDeclarationSyntax WithIdentifier(SyntaxToken identifier)
{
//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)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
return Update(AttributeLists, Modifiers, DelegateKeyword, ReturnType, identifier, TypeParameterList, ParameterList, ConstraintClauses, SemicolonToken);
}
public DelegateDeclarationSyntax WithTypeParameterList(TypeParameterListSyntax? typeParameterList)
{
//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)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
return Update(AttributeLists, Modifiers, DelegateKeyword, ReturnType, Identifier, typeParameterList, ParameterList, ConstraintClauses, SemicolonToken);
}
public DelegateDeclarationSyntax WithParameterList(ParameterListSyntax parameterList)
{
//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)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
return Update(AttributeLists, Modifiers, DelegateKeyword, ReturnType, Identifier, TypeParameterList, parameterList, ConstraintClauses, SemicolonToken);
}
public DelegateDeclarationSyntax WithConstraintClauses(SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses)
{
//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)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
return Update(AttributeLists, Modifiers, DelegateKeyword, ReturnType, Identifier, TypeParameterList, ParameterList, constraintClauses, SemicolonToken);
}
public DelegateDeclarationSyntax WithSemicolonToken(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)
//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)
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
return Update(AttributeLists, Modifiers, DelegateKeyword, ReturnType, Identifier, TypeParameterList, ParameterList, ConstraintClauses, semicolonToken);
}
internal override MemberDeclarationSyntax AddAttributeListsCore(params AttributeListSyntax[] items)
{
return AddAttributeLists(items);
}
public new DelegateDeclarationSyntax 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));
}
internal override MemberDeclarationSyntax AddModifiersCore(params SyntaxToken[] items)
{
return AddModifiers(items);
}
public new DelegateDeclarationSyntax AddModifiers(params SyntaxToken[] 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)
SyntaxTokenList modifiers = Modifiers;
return WithModifiers(((SyntaxTokenList)(ref modifiers)).AddRange((IEnumerable<SyntaxToken>)items));
}
public DelegateDeclarationSyntax AddTypeParameterListParameters(params TypeParameterSyntax[] items)
{
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: 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_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
TypeParameterListSyntax typeParameterListSyntax = TypeParameterList ?? SyntaxFactory.TypeParameterList();
return WithTypeParameterList(typeParameterListSyntax.WithParameters(typeParameterListSyntax.Parameters.AddRange((IEnumerable<TypeParameterSyntax>)items)));
}
public DelegateDeclarationSyntax AddParameterListParameters(params ParameterSyntax[] items)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
return WithParameterList(ParameterList.WithParameters(ParameterList.Parameters.AddRange((IEnumerable<ParameterSyntax>)items)));
}
public DelegateDeclarationSyntax AddConstraintClauses(params TypeParameterConstraintClauseSyntax[] 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 WithConstraintClauses(ConstraintClauses.AddRange((IEnumerable<TypeParameterConstraintClauseSyntax>)items));
}
}