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

105 lines
4.8 KiB
C#

using System.Collections.Generic;
using Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax;
namespace Microsoft.CodeAnalysis.CSharp.Syntax;
public sealed class InterpolatedStringExpressionSyntax : ExpressionSyntax
{
private SyntaxNode? contents;
public SyntaxToken StringStartToken => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.InterpolatedStringExpressionSyntax)(object)((SyntaxNode)this).Green).stringStartToken, ((SyntaxNode)this).Position, 0);
public SyntaxList<InterpolatedStringContentSyntax> Contents => new SyntaxList<InterpolatedStringContentSyntax>(((SyntaxNode)this).GetRed(ref contents, 1));
public SyntaxToken StringEndToken => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.InterpolatedStringExpressionSyntax)(object)((SyntaxNode)this).Green).stringEndToken, ((SyntaxNode)this).GetChildPosition(2), ((SyntaxNode)this).GetChildIndex(2));
internal InterpolatedStringExpressionSyntax(Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.CSharpSyntaxNode green, SyntaxNode? parent, int position)
: base(green, parent, position)
{
}
internal override SyntaxNode? GetNodeSlot(int index)
{
if (index != 1)
{
return null;
}
return ((SyntaxNode)this).GetRed(ref contents, 1);
}
internal override SyntaxNode? GetCachedSlot(int index)
{
if (index != 1)
{
return null;
}
return contents;
}
public override void Accept(CSharpSyntaxVisitor visitor)
{
visitor.VisitInterpolatedStringExpression(this);
}
public override TResult? Accept<TResult>(CSharpSyntaxVisitor<TResult> visitor)
{
return visitor.VisitInterpolatedStringExpression(this);
}
public InterpolatedStringExpressionSyntax Update(SyntaxToken stringStartToken, SyntaxList<InterpolatedStringContentSyntax> contents, SyntaxToken stringEndToken)
{
//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_002a: 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_002c: 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)
if (stringStartToken != StringStartToken || contents != Contents || stringEndToken != StringEndToken)
{
InterpolatedStringExpressionSyntax interpolatedStringExpressionSyntax = SyntaxFactory.InterpolatedStringExpression(stringStartToken, contents, stringEndToken);
SyntaxAnnotation[] annotations = ((SyntaxNode)this).GetAnnotations();
if (annotations == null || annotations.Length == 0)
{
return interpolatedStringExpressionSyntax;
}
return interpolatedStringExpressionSyntax.WithAnnotations(annotations);
}
return this;
}
public InterpolatedStringExpressionSyntax WithStringStartToken(SyntaxToken stringStartToken)
{
//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)
return Update(stringStartToken, Contents, StringEndToken);
}
public InterpolatedStringExpressionSyntax WithContents(SyntaxList<InterpolatedStringContentSyntax> contents)
{
//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)
return Update(StringStartToken, contents, StringEndToken);
}
public InterpolatedStringExpressionSyntax WithStringEndToken(SyntaxToken stringEndToken)
{
//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)
return Update(StringStartToken, Contents, stringEndToken);
}
public InterpolatedStringExpressionSyntax AddContents(params InterpolatedStringContentSyntax[] 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 WithContents(Contents.AddRange((IEnumerable<InterpolatedStringContentSyntax>)items));
}
}