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

332 lines
19 KiB
C#

using System.Collections.Generic;
using Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax;
namespace Microsoft.CodeAnalysis.CSharp.Syntax;
public sealed class LocalFunctionStatementSyntax : StatementSyntax
{
private SyntaxNode? attributeLists;
private TypeSyntax? returnType;
private TypeParameterListSyntax? typeParameterList;
private ParameterListSyntax? parameterList;
private SyntaxNode? constraintClauses;
private BlockSyntax? body;
private ArrowExpressionClauseSyntax? expressionBody;
public override SyntaxList<AttributeListSyntax> AttributeLists => new SyntaxList<AttributeListSyntax>(((SyntaxNode)this).GetRed(ref attributeLists, 0));
public 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 TypeSyntax ReturnType => ((SyntaxNode)this).GetRed<TypeSyntax>(ref returnType, 2);
public SyntaxToken Identifier => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LocalFunctionStatementSyntax)(object)((SyntaxNode)this).Green).identifier, ((SyntaxNode)this).GetChildPosition(3), ((SyntaxNode)this).GetChildIndex(3));
public TypeParameterListSyntax? TypeParameterList => ((SyntaxNode)this).GetRed<TypeParameterListSyntax>(ref typeParameterList, 4);
public ParameterListSyntax ParameterList => ((SyntaxNode)this).GetRed<ParameterListSyntax>(ref parameterList, 5);
public SyntaxList<TypeParameterConstraintClauseSyntax> ConstraintClauses => new SyntaxList<TypeParameterConstraintClauseSyntax>(((SyntaxNode)this).GetRed(ref constraintClauses, 6));
public BlockSyntax? Body => ((SyntaxNode)this).GetRed<BlockSyntax>(ref body, 7);
public ArrowExpressionClauseSyntax? ExpressionBody => ((SyntaxNode)this).GetRed<ArrowExpressionClauseSyntax>(ref expressionBody, 8);
public SyntaxToken SemicolonToken
{
get
{
//IL_0030: 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 semicolonToken = ((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LocalFunctionStatementSyntax)(object)((SyntaxNode)this).Green).semicolonToken;
if (semicolonToken == null)
{
return default(SyntaxToken);
}
return new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)semicolonToken, ((SyntaxNode)this).GetChildPosition(9), ((SyntaxNode)this).GetChildIndex(9));
}
}
public LocalFunctionStatementSyntax Update(SyntaxTokenList modifiers, TypeSyntax returnType, SyntaxToken identifier, TypeParameterListSyntax typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, BlockSyntax body, ArrowExpressionClauseSyntax expressionBody, SyntaxToken semicolonToken)
{
//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_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
return Update(AttributeLists, modifiers, returnType, identifier, typeParameterList, parameterList, constraintClauses, body, expressionBody, semicolonToken);
}
internal LocalFunctionStatementSyntax(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),
2 => ((SyntaxNode)this).GetRed<TypeSyntax>(ref returnType, 2),
4 => ((SyntaxNode)this).GetRed<TypeParameterListSyntax>(ref typeParameterList, 4),
5 => ((SyntaxNode)this).GetRed<ParameterListSyntax>(ref parameterList, 5),
6 => ((SyntaxNode)this).GetRed(ref constraintClauses, 6),
7 => ((SyntaxNode)this).GetRed<BlockSyntax>(ref body, 7),
8 => ((SyntaxNode)this).GetRed<ArrowExpressionClauseSyntax>(ref expressionBody, 8),
_ => null,
});
}
internal override SyntaxNode? GetCachedSlot(int index)
{
return (SyntaxNode?)(index switch
{
0 => attributeLists,
2 => returnType,
4 => typeParameterList,
5 => parameterList,
6 => constraintClauses,
7 => body,
8 => expressionBody,
_ => null,
});
}
public override void Accept(CSharpSyntaxVisitor visitor)
{
visitor.VisitLocalFunctionStatement(this);
}
public override TResult? Accept<TResult>(CSharpSyntaxVisitor<TResult> visitor)
{
return visitor.VisitLocalFunctionStatement(this);
}
public LocalFunctionStatementSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax returnType, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody, 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_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: 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_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
if (attributeLists != AttributeLists || modifiers != Modifiers || returnType != ReturnType || identifier != Identifier || typeParameterList != TypeParameterList || parameterList != ParameterList || constraintClauses != ConstraintClauses || body != Body || expressionBody != ExpressionBody || semicolonToken != SemicolonToken)
{
LocalFunctionStatementSyntax localFunctionStatementSyntax = SyntaxFactory.LocalFunctionStatement(attributeLists, modifiers, returnType, identifier, typeParameterList, parameterList, constraintClauses, body, expressionBody, semicolonToken);
SyntaxAnnotation[] annotations = ((SyntaxNode)this).GetAnnotations();
if (annotations == null || annotations.Length == 0)
{
return localFunctionStatementSyntax;
}
return localFunctionStatementSyntax.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 LocalFunctionStatementSyntax 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_000f: 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_0033: Unknown result type (might be due to invalid IL or missing references)
return Update(attributeLists, Modifiers, ReturnType, Identifier, TypeParameterList, ParameterList, ConstraintClauses, Body, ExpressionBody, SemicolonToken);
}
public LocalFunctionStatementSyntax 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_000f: 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_0033: Unknown result type (might be due to invalid IL or missing references)
return Update(AttributeLists, modifiers, ReturnType, Identifier, TypeParameterList, ParameterList, ConstraintClauses, Body, ExpressionBody, SemicolonToken);
}
public LocalFunctionStatementSyntax 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_000f: 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_0033: Unknown result type (might be due to invalid IL or missing references)
return Update(AttributeLists, Modifiers, returnType, Identifier, TypeParameterList, ParameterList, ConstraintClauses, Body, ExpressionBody, SemicolonToken);
}
public LocalFunctionStatementSyntax 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_0013: 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_0033: Unknown result type (might be due to invalid IL or missing references)
return Update(AttributeLists, Modifiers, ReturnType, identifier, TypeParameterList, ParameterList, ConstraintClauses, Body, ExpressionBody, SemicolonToken);
}
public LocalFunctionStatementSyntax 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_0014: 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_0033: Unknown result type (might be due to invalid IL or missing references)
return Update(AttributeLists, Modifiers, ReturnType, Identifier, typeParameterList, ParameterList, ConstraintClauses, Body, ExpressionBody, SemicolonToken);
}
public LocalFunctionStatementSyntax 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_0014: 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_0033: Unknown result type (might be due to invalid IL or missing references)
return Update(AttributeLists, Modifiers, ReturnType, Identifier, TypeParameterList, parameterList, ConstraintClauses, Body, ExpressionBody, SemicolonToken);
}
public LocalFunctionStatementSyntax 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_0014: 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_0033: Unknown result type (might be due to invalid IL or missing references)
return Update(AttributeLists, Modifiers, ReturnType, Identifier, TypeParameterList, ParameterList, constraintClauses, Body, ExpressionBody, SemicolonToken);
}
public LocalFunctionStatementSyntax WithBody(BlockSyntax? body)
{
//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_0014: 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_0033: Unknown result type (might be due to invalid IL or missing references)
return Update(AttributeLists, Modifiers, ReturnType, Identifier, TypeParameterList, ParameterList, ConstraintClauses, body, ExpressionBody, SemicolonToken);
}
public LocalFunctionStatementSyntax WithExpressionBody(ArrowExpressionClauseSyntax? expressionBody)
{
//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_0014: 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_0033: Unknown result type (might be due to invalid IL or missing references)
return Update(AttributeLists, Modifiers, ReturnType, Identifier, TypeParameterList, ParameterList, ConstraintClauses, Body, expressionBody, SemicolonToken);
}
public LocalFunctionStatementSyntax 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_0014: 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_0037: Unknown result type (might be due to invalid IL or missing references)
return Update(AttributeLists, Modifiers, ReturnType, Identifier, TypeParameterList, ParameterList, ConstraintClauses, Body, ExpressionBody, semicolonToken);
}
internal override StatementSyntax AddAttributeListsCore(params AttributeListSyntax[] items)
{
return AddAttributeLists(items);
}
public new LocalFunctionStatementSyntax 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));
}
public LocalFunctionStatementSyntax 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 LocalFunctionStatementSyntax 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 LocalFunctionStatementSyntax 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 LocalFunctionStatementSyntax 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));
}
public LocalFunctionStatementSyntax AddBodyAttributeLists(params AttributeListSyntax[] 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)
BlockSyntax blockSyntax = Body ?? SyntaxFactory.Block();
return WithBody(blockSyntax.WithAttributeLists(blockSyntax.AttributeLists.AddRange((IEnumerable<AttributeListSyntax>)items)));
}
public LocalFunctionStatementSyntax AddBodyStatements(params StatementSyntax[] 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)
BlockSyntax blockSyntax = Body ?? SyntaxFactory.Block();
return WithBody(blockSyntax.WithStatements(blockSyntax.Statements.AddRange((IEnumerable<StatementSyntax>)items)));
}
}