public IGotoLabelInternal CreateLabel(string name, GotoLabelStatementSyntax labelSyntax) { var label = new GotoLabel(name, labelSyntax); _labels[name] = label; return(label); }
public override void VisitGotoLabelStatement(GotoLabelStatementSyntax node) { var scope = FindScope(node) ?? throw new System.Exception("Scope not found for node."); var label = scope.CreateLabel(node.Identifier.Text, node); _labels[node] = label; }
public GotoLabel(string name, GotoLabelStatementSyntax label) { RoslynDebug.Assert(!string.IsNullOrEmpty(name)); RoslynDebug.AssertNotNull(label); Name = name; LabelSyntax = label; JumpSyntaxes = SpecializedCollections.ReadOnlyEnumerable(_jumps); }
public IGotoLabelInternal GetOrCreateLabel(string name, GotoLabelStatementSyntax labelSyntax) { RoslynDebug.Assert(!string.IsNullOrEmpty(name)); RoslynDebug.AssertNotNull(labelSyntax); if (!TryGetLabel(name, out var label)) { label = CreateLabel(name, labelSyntax); } return(label); }
public override void VisitGotoLabelStatement(GotoLabelStatementSyntax node) { var scope = (IScopeInternal)_scopes[node.Parent !];