126 lines
5.2 KiB
C#
126 lines
5.2 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax;
|
|
|
|
namespace Microsoft.CodeAnalysis.CSharp.Syntax;
|
|
|
|
public abstract class AnonymousFunctionExpressionSyntax : ExpressionSyntax
|
|
{
|
|
public CSharpSyntaxNode Body => (CSharpSyntaxNode)(((object)Block) ?? ((object)ExpressionBody));
|
|
|
|
public abstract SyntaxToken AsyncKeyword { get; }
|
|
|
|
public abstract SyntaxTokenList Modifiers { get; }
|
|
|
|
public abstract BlockSyntax? Block { get; }
|
|
|
|
public abstract ExpressionSyntax? ExpressionBody { get; }
|
|
|
|
public AnonymousFunctionExpressionSyntax WithBody(CSharpSyntaxNode body)
|
|
{
|
|
if (!(body is BlockSyntax block))
|
|
{
|
|
return WithExpressionBody((ExpressionSyntax)body).WithBlock(null);
|
|
}
|
|
return WithBlock(block).WithExpressionBody(null);
|
|
}
|
|
|
|
public AnonymousFunctionExpressionSyntax WithAsyncKeyword(SyntaxToken asyncKeyword)
|
|
{
|
|
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
|
|
return WithAsyncKeywordCore(asyncKeyword);
|
|
}
|
|
|
|
internal abstract AnonymousFunctionExpressionSyntax WithAsyncKeywordCore(SyntaxToken asyncKeyword);
|
|
|
|
private protected SyntaxTokenList UpdateAsyncKeyword(SyntaxToken asyncKeyword)
|
|
{
|
|
//IL_0000: 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_0060: Unknown result type (might be due to invalid IL or missing references)
|
|
//IL_0065: 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)
|
|
//IL_006f: 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_0088: Unknown result type (might be due to invalid IL or missing references)
|
|
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
|
|
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
|
|
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
|
|
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
|
|
//IL_0078: 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_0080: Unknown result type (might be due to invalid IL or missing references)
|
|
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
|
|
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
|
|
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
|
|
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
|
|
if (asyncKeyword == default(SyntaxToken))
|
|
{
|
|
if (Modifiers.Any(SyntaxKind.AsyncKeyword))
|
|
{
|
|
return new SyntaxTokenList(((IEnumerable<SyntaxToken>)(object)Modifiers).Where((SyntaxToken m) => !m.IsKind(SyntaxKind.AsyncKeyword)));
|
|
}
|
|
return Modifiers;
|
|
}
|
|
SyntaxToken asyncKeyword2 = AsyncKeyword;
|
|
SyntaxTokenList modifiers;
|
|
if (asyncKeyword2 == default(SyntaxToken))
|
|
{
|
|
modifiers = Modifiers;
|
|
return ((SyntaxTokenList)(ref modifiers)).Add(asyncKeyword);
|
|
}
|
|
modifiers = Modifiers;
|
|
return ((SyntaxTokenList)(ref modifiers)).Replace(asyncKeyword2, asyncKeyword);
|
|
}
|
|
|
|
internal AnonymousFunctionExpressionSyntax(Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.CSharpSyntaxNode green, SyntaxNode? parent, int position)
|
|
: base(green, parent, position)
|
|
{
|
|
}
|
|
|
|
public AnonymousFunctionExpressionSyntax WithModifiers(SyntaxTokenList modifiers)
|
|
{
|
|
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
|
|
return WithModifiersCore(modifiers);
|
|
}
|
|
|
|
internal abstract AnonymousFunctionExpressionSyntax WithModifiersCore(SyntaxTokenList modifiers);
|
|
|
|
public AnonymousFunctionExpressionSyntax AddModifiers(params SyntaxToken[] items)
|
|
{
|
|
return AddModifiersCore(items);
|
|
}
|
|
|
|
internal abstract AnonymousFunctionExpressionSyntax AddModifiersCore(params SyntaxToken[] items);
|
|
|
|
public AnonymousFunctionExpressionSyntax WithBlock(BlockSyntax? block)
|
|
{
|
|
return WithBlockCore(block);
|
|
}
|
|
|
|
internal abstract AnonymousFunctionExpressionSyntax WithBlockCore(BlockSyntax? block);
|
|
|
|
public AnonymousFunctionExpressionSyntax AddBlockAttributeLists(params AttributeListSyntax[] items)
|
|
{
|
|
return AddBlockAttributeListsCore(items);
|
|
}
|
|
|
|
internal abstract AnonymousFunctionExpressionSyntax AddBlockAttributeListsCore(params AttributeListSyntax[] items);
|
|
|
|
public AnonymousFunctionExpressionSyntax AddBlockStatements(params StatementSyntax[] items)
|
|
{
|
|
return AddBlockStatementsCore(items);
|
|
}
|
|
|
|
internal abstract AnonymousFunctionExpressionSyntax AddBlockStatementsCore(params StatementSyntax[] items);
|
|
|
|
public AnonymousFunctionExpressionSyntax WithExpressionBody(ExpressionSyntax? expressionBody)
|
|
{
|
|
return WithExpressionBodyCore(expressionBody);
|
|
}
|
|
|
|
internal abstract AnonymousFunctionExpressionSyntax WithExpressionBodyCore(ExpressionSyntax? expressionBody);
|
|
}
|