Files

36 lines
1.1 KiB
C#
Raw Permalink Normal View History

2026-08-27 10:56:38 -06:00
using System.Collections.Immutable;
using System.Diagnostics;
namespace Microsoft.CodeAnalysis.CSharp;
internal sealed class BoundStateMachineScope : BoundStatement
{
public ImmutableArray<StateMachineFieldSymbol> Fields { get; }
public BoundStatement Statement { get; }
public BoundStateMachineScope(SyntaxNode syntax, ImmutableArray<StateMachineFieldSymbol> fields, BoundStatement statement, bool hasErrors = false)
: base(BoundKind.StateMachineScope, syntax, hasErrors || statement.HasErrors())
{
Fields = fields;
Statement = statement;
}
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor)
{
return visitor.VisitStateMachineScope(this);
}
public BoundStateMachineScope Update(ImmutableArray<StateMachineFieldSymbol> fields, BoundStatement statement)
{
if (fields != Fields || statement != Statement)
{
BoundStateMachineScope boundStateMachineScope = new BoundStateMachineScope(Syntax, fields, statement, base.HasErrors);
boundStateMachineScope.CopyAttributes(this);
return boundStateMachineScope;
}
return this;
}
}