Пример #1
0
        public IGotoLabelInternal CreateLabel(string name, GotoLabelStatementSyntax labelSyntax)
        {
            var label = new GotoLabel(name, labelSyntax);

            _labels[name] = label;
            return(label);
        }
Пример #2
0
            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;
            }
Пример #3
0
        public GotoLabel(string name, GotoLabelStatementSyntax label)
        {
            RoslynDebug.Assert(!string.IsNullOrEmpty(name));
            RoslynDebug.AssertNotNull(label);

            Name         = name;
            LabelSyntax  = label;
            JumpSyntaxes = SpecializedCollections.ReadOnlyEnumerable(_jumps);
        }
Пример #4
0
        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);
        }
Пример #5
0
 public override void VisitGotoLabelStatement(GotoLabelStatementSyntax node)
 {
     var scope = (IScopeInternal)_scopes[node.Parent !];