164 lines
7.1 KiB
C#
164 lines
7.1 KiB
C#
using System;
|
|||
|
|
using System.Collections.Generic;
|
||
|
|
using Microsoft.CodeAnalysis.Syntax.InternalSyntax;
|
||
|
|
using Roslyn.Utilities;
|
||
|
|
|
||
|
|
namespace Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax;
|
||
|
|
|
||
|
|
internal sealed class FunctionPointerUnmanagedCallingConventionListSyntax : CSharpSyntaxNode
|
||
|
|
{
|
||
|
|
internal readonly SyntaxToken openBracketToken;
|
||
|
|
|
||
|
|
internal readonly GreenNode? callingConventions;
|
||
|
|
|
||
|
|
internal readonly SyntaxToken closeBracketToken;
|
||
|
|
|
||
|
|
public SyntaxToken OpenBracketToken => openBracketToken;
|
||
|
|
|
||
|
|
public SeparatedSyntaxList<FunctionPointerUnmanagedCallingConventionSyntax> CallingConventions => new SeparatedSyntaxList<FunctionPointerUnmanagedCallingConventionSyntax>(SyntaxList<CSharpSyntaxNode>.op_Implicit(new SyntaxList<CSharpSyntaxNode>(callingConventions)));
|
||
|
|
|
||
|
|
public SyntaxToken CloseBracketToken => closeBracketToken;
|
||
|
|
|
||
|
|
internal FunctionPointerUnmanagedCallingConventionListSyntax(SyntaxKind kind, SyntaxToken openBracketToken, GreenNode? callingConventions, SyntaxToken closeBracketToken, DiagnosticInfo[]? diagnostics, SyntaxAnnotation[]? annotations)
|
||
|
|
: base(kind, diagnostics, annotations)
|
||
|
|
{
|
||
|
|
((GreenNode)this).SlotCount = 3;
|
||
|
|
((GreenNode)this).AdjustFlagsAndWidth((GreenNode)(object)openBracketToken);
|
||
|
|
this.openBracketToken = openBracketToken;
|
||
|
|
if (callingConventions != null)
|
||
|
|
{
|
||
|
|
((GreenNode)this).AdjustFlagsAndWidth(callingConventions);
|
||
|
|
this.callingConventions = callingConventions;
|
||
|
|
}
|
||
|
|
((GreenNode)this).AdjustFlagsAndWidth((GreenNode)(object)closeBracketToken);
|
||
|
|
this.closeBracketToken = closeBracketToken;
|
||
|
|
}
|
||
|
|
|
||
|
|
internal FunctionPointerUnmanagedCallingConventionListSyntax(SyntaxKind kind, SyntaxToken openBracketToken, GreenNode? callingConventions, SyntaxToken closeBracketToken, SyntaxFactoryContext context)
|
||
|
|
: base(kind)
|
||
|
|
{
|
||
|
|
SetFactoryContext(context);
|
||
|
|
((GreenNode)this).SlotCount = 3;
|
||
|
|
((GreenNode)this).AdjustFlagsAndWidth((GreenNode)(object)openBracketToken);
|
||
|
|
this.openBracketToken = openBracketToken;
|
||
|
|
if (callingConventions != null)
|
||
|
|
{
|
||
|
|
((GreenNode)this).AdjustFlagsAndWidth(callingConventions);
|
||
|
|
this.callingConventions = callingConventions;
|
||
|
|
}
|
||
|
|
((GreenNode)this).AdjustFlagsAndWidth((GreenNode)(object)closeBracketToken);
|
||
|
|
this.closeBracketToken = closeBracketToken;
|
||
|
|
}
|
||
|
|
|
||
|
|
internal FunctionPointerUnmanagedCallingConventionListSyntax(SyntaxKind kind, SyntaxToken openBracketToken, GreenNode? callingConventions, SyntaxToken closeBracketToken)
|
||
|
|
: base(kind)
|
||
|
|
{
|
||
|
|
((GreenNode)this).SlotCount = 3;
|
||
|
|
((GreenNode)this).AdjustFlagsAndWidth((GreenNode)(object)openBracketToken);
|
||
|
|
this.openBracketToken = openBracketToken;
|
||
|
|
if (callingConventions != null)
|
||
|
|
{
|
||
|
|
((GreenNode)this).AdjustFlagsAndWidth(callingConventions);
|
||
|
|
this.callingConventions = callingConventions;
|
||
|
|
}
|
||
|
|
((GreenNode)this).AdjustFlagsAndWidth((GreenNode)(object)closeBracketToken);
|
||
|
|
this.closeBracketToken = closeBracketToken;
|
||
|
|
}
|
||
|
|
|
||
|
|
internal override GreenNode? GetSlot(int index)
|
||
|
|
{
|
||
|
|
return (GreenNode?)(index switch
|
||
|
|
{
|
||
|
|
0 => openBracketToken,
|
||
|
|
1 => callingConventions,
|
||
|
|
2 => closeBracketToken,
|
||
|
|
_ => null,
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
internal override SyntaxNode CreateRed(SyntaxNode? parent, int position)
|
||
|
|
{
|
||
|
|
return (SyntaxNode)(object)new Microsoft.CodeAnalysis.CSharp.Syntax.FunctionPointerUnmanagedCallingConventionListSyntax(this, parent, position);
|
||
|
|
}
|
||
|
|
|
||
|
|
public override void Accept(CSharpSyntaxVisitor visitor)
|
||
|
|
{
|
||
|
|
visitor.VisitFunctionPointerUnmanagedCallingConventionList(this);
|
||
|
|
}
|
||
|
|
|
||
|
|
public override TResult Accept<TResult>(CSharpSyntaxVisitor<TResult> visitor)
|
||
|
|
{
|
||
|
|
return visitor.VisitFunctionPointerUnmanagedCallingConventionList(this);
|
||
|
|
}
|
||
|
|
|
||
|
|
public FunctionPointerUnmanagedCallingConventionListSyntax Update(SyntaxToken openBracketToken, SeparatedSyntaxList<FunctionPointerUnmanagedCallingConventionSyntax> callingConventions, SyntaxToken closeBracketToken)
|
||
|
|
{
|
||
|
|
//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_0011: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
if (openBracketToken == OpenBracketToken)
|
||
|
|
{
|
||
|
|
SeparatedSyntaxList<FunctionPointerUnmanagedCallingConventionSyntax> val = CallingConventions;
|
||
|
|
if (!((ref callingConventions) != (ref val)) && closeBracketToken == CloseBracketToken)
|
||
|
|
{
|
||
|
|
return this;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
FunctionPointerUnmanagedCallingConventionListSyntax functionPointerUnmanagedCallingConventionListSyntax = SyntaxFactory.FunctionPointerUnmanagedCallingConventionList(openBracketToken, callingConventions, closeBracketToken);
|
||
|
|
DiagnosticInfo[] diagnostics = ((GreenNode)this).GetDiagnostics();
|
||
|
|
if (diagnostics != null && diagnostics.Length != 0)
|
||
|
|
{
|
||
|
|
functionPointerUnmanagedCallingConventionListSyntax = GreenNodeExtensions.WithDiagnosticsGreen<FunctionPointerUnmanagedCallingConventionListSyntax>(functionPointerUnmanagedCallingConventionListSyntax, diagnostics);
|
||
|
|
}
|
||
|
|
SyntaxAnnotation[] annotations = ((GreenNode)this).GetAnnotations();
|
||
|
|
if (annotations != null && annotations.Length != 0)
|
||
|
|
{
|
||
|
|
functionPointerUnmanagedCallingConventionListSyntax = GreenNodeExtensions.WithAnnotationsGreen<FunctionPointerUnmanagedCallingConventionListSyntax>(functionPointerUnmanagedCallingConventionListSyntax, (IEnumerable<SyntaxAnnotation>)annotations);
|
||
|
|
}
|
||
|
|
return functionPointerUnmanagedCallingConventionListSyntax;
|
||
|
|
}
|
||
|
|
|
||
|
|
internal override GreenNode SetDiagnostics(DiagnosticInfo[]? diagnostics)
|
||
|
|
{
|
||
|
|
return (GreenNode)(object)new FunctionPointerUnmanagedCallingConventionListSyntax(base.Kind, openBracketToken, callingConventions, closeBracketToken, diagnostics, ((GreenNode)this).GetAnnotations());
|
||
|
|
}
|
||
|
|
|
||
|
|
internal override GreenNode SetAnnotations(SyntaxAnnotation[]? annotations)
|
||
|
|
{
|
||
|
|
return (GreenNode)(object)new FunctionPointerUnmanagedCallingConventionListSyntax(base.Kind, openBracketToken, callingConventions, closeBracketToken, ((GreenNode)this).GetDiagnostics(), annotations);
|
||
|
|
}
|
||
|
|
|
||
|
|
internal FunctionPointerUnmanagedCallingConventionListSyntax(ObjectReader reader)
|
||
|
|
: base(reader)
|
||
|
|
{
|
||
|
|
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0034: Expected O, but got Unknown
|
||
|
|
((GreenNode)this).SlotCount = 3;
|
||
|
|
SyntaxToken syntaxToken = (SyntaxToken)reader.ReadValue();
|
||
|
|
((GreenNode)this).AdjustFlagsAndWidth((GreenNode)(object)syntaxToken);
|
||
|
|
openBracketToken = syntaxToken;
|
||
|
|
GreenNode val = (GreenNode)reader.ReadValue();
|
||
|
|
if (val != null)
|
||
|
|
{
|
||
|
|
((GreenNode)this).AdjustFlagsAndWidth(val);
|
||
|
|
callingConventions = val;
|
||
|
|
}
|
||
|
|
SyntaxToken syntaxToken2 = (SyntaxToken)reader.ReadValue();
|
||
|
|
((GreenNode)this).AdjustFlagsAndWidth((GreenNode)(object)syntaxToken2);
|
||
|
|
closeBracketToken = syntaxToken2;
|
||
|
|
}
|
||
|
|
|
||
|
|
internal override void WriteTo(ObjectWriter writer)
|
||
|
|
{
|
||
|
|
((GreenNode)this).WriteTo(writer);
|
||
|
|
writer.WriteValue((IObjectWritable)(object)openBracketToken);
|
||
|
|
writer.WriteValue((IObjectWritable)(object)callingConventions);
|
||
|
|
writer.WriteValue((IObjectWritable)(object)closeBracketToken);
|
||
|
|
}
|
||
|
|
|
||
|
|
static FunctionPointerUnmanagedCallingConventionListSyntax()
|
||
|
|
{
|
||
|
|
ObjectBinder.RegisterTypeReader(typeof(FunctionPointerUnmanagedCallingConventionListSyntax), (Func<ObjectReader, IObjectWritable>)((ObjectReader r) => (IObjectWritable)(object)new FunctionPointerUnmanagedCallingConventionListSyntax(r)));
|
||
|
|
}
|
||
|
|
}
|