136 lines
5.0 KiB
C#
136 lines
5.0 KiB
C#
using System.ComponentModel;
|
|
using Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax;
|
|
|
|
namespace Microsoft.CodeAnalysis.CSharp.Syntax;
|
|
|
|
public sealed class CrefParameterSyntax : CSharpSyntaxNode
|
|
{
|
|
private TypeSyntax? type;
|
|
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
public SyntaxToken RefOrOutKeyword => RefKindKeyword;
|
|
|
|
public SyntaxToken RefKindKeyword
|
|
{
|
|
get
|
|
{
|
|
//IL_0027: 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)
|
|
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
|
|
SyntaxToken refKindKeyword = ((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.CrefParameterSyntax)(object)((SyntaxNode)this).Green).refKindKeyword;
|
|
if (refKindKeyword == null)
|
|
{
|
|
return default(SyntaxToken);
|
|
}
|
|
return new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)refKindKeyword, ((SyntaxNode)this).Position, 0);
|
|
}
|
|
}
|
|
|
|
public SyntaxToken ReadOnlyKeyword
|
|
{
|
|
get
|
|
{
|
|
//IL_002e: 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)
|
|
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
|
|
SyntaxToken readOnlyKeyword = ((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.CrefParameterSyntax)(object)((SyntaxNode)this).Green).readOnlyKeyword;
|
|
if (readOnlyKeyword == null)
|
|
{
|
|
return default(SyntaxToken);
|
|
}
|
|
return new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)readOnlyKeyword, ((SyntaxNode)this).GetChildPosition(1), ((SyntaxNode)this).GetChildIndex(1));
|
|
}
|
|
}
|
|
|
|
public TypeSyntax Type => ((SyntaxNode)this).GetRed<TypeSyntax>(ref type, 2);
|
|
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
public CrefParameterSyntax WithRefOrOutKeyword(SyntaxToken refOrOutKeyword)
|
|
{
|
|
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
|
|
return Update(refOrOutKeyword, Type);
|
|
}
|
|
|
|
public CrefParameterSyntax Update(SyntaxToken refKindKeyword, TypeSyntax type)
|
|
{
|
|
//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(refKindKeyword, ReadOnlyKeyword, type);
|
|
}
|
|
|
|
internal CrefParameterSyntax(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 != 2)
|
|
{
|
|
return null;
|
|
}
|
|
return (SyntaxNode?)(object)((SyntaxNode)this).GetRed<TypeSyntax>(ref type, 2);
|
|
}
|
|
|
|
internal override SyntaxNode? GetCachedSlot(int index)
|
|
{
|
|
if (index != 2)
|
|
{
|
|
return null;
|
|
}
|
|
return (SyntaxNode?)(object)type;
|
|
}
|
|
|
|
public override void Accept(CSharpSyntaxVisitor visitor)
|
|
{
|
|
visitor.VisitCrefParameter(this);
|
|
}
|
|
|
|
public override TResult? Accept<TResult>(CSharpSyntaxVisitor<TResult> visitor)
|
|
{
|
|
return visitor.VisitCrefParameter(this);
|
|
}
|
|
|
|
public CrefParameterSyntax Update(SyntaxToken refKindKeyword, SyntaxToken readOnlyKeyword, TypeSyntax type)
|
|
{
|
|
//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_0025: Unknown result type (might be due to invalid IL or missing references)
|
|
//IL_0026: 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 (refKindKeyword != RefKindKeyword || readOnlyKeyword != ReadOnlyKeyword || type != Type)
|
|
{
|
|
CrefParameterSyntax crefParameterSyntax = SyntaxFactory.CrefParameter(refKindKeyword, readOnlyKeyword, type);
|
|
SyntaxAnnotation[] annotations = ((SyntaxNode)this).GetAnnotations();
|
|
if (annotations == null || annotations.Length == 0)
|
|
{
|
|
return crefParameterSyntax;
|
|
}
|
|
return crefParameterSyntax.WithAnnotations(annotations);
|
|
}
|
|
return this;
|
|
}
|
|
|
|
public CrefParameterSyntax WithRefKindKeyword(SyntaxToken refKindKeyword)
|
|
{
|
|
//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(refKindKeyword, ReadOnlyKeyword, Type);
|
|
}
|
|
|
|
public CrefParameterSyntax WithReadOnlyKeyword(SyntaxToken readOnlyKeyword)
|
|
{
|
|
//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(RefKindKeyword, readOnlyKeyword, Type);
|
|
}
|
|
|
|
public CrefParameterSyntax WithType(TypeSyntax type)
|
|
{
|
|
//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)
|
|
return Update(RefKindKeyword, ReadOnlyKeyword, type);
|
|
}
|
|
}
|