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

39 lines
1.0 KiB
C#

using System.Diagnostics;
using Microsoft.CodeAnalysis.CSharp.Symbols;
namespace Microsoft.CodeAnalysis.CSharp;
internal sealed class BoundLeafDecisionDagNode : BoundDecisionDagNode
{
public LabelSymbol Label { get; }
public BoundLeafDecisionDagNode(SyntaxNode syntax, LabelSymbol label, bool hasErrors)
: base(BoundKind.LeafDecisionDagNode, syntax, hasErrors)
{
Label = label;
}
public BoundLeafDecisionDagNode(SyntaxNode syntax, LabelSymbol label)
: base(BoundKind.LeafDecisionDagNode, syntax)
{
Label = label;
}
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor)
{
return visitor.VisitLeafDecisionDagNode(this);
}
public BoundLeafDecisionDagNode Update(LabelSymbol label)
{
if (!SymbolEqualityComparer.ConsiderEverything.Equals(label, Label))
{
BoundLeafDecisionDagNode boundLeafDecisionDagNode = new BoundLeafDecisionDagNode(Syntax, label, base.HasErrors);
boundLeafDecisionDagNode.CopyAttributes(this);
return boundLeafDecisionDagNode;
}
return this;
}
}