Exemplo n.º 1
0
        private static IEnumerable <SyntaxDiagnostic> GetDiagnosticsRecursive(Internal.GreenNode node, int position)
        {
            if (node.HasDiagnostics)
            {
                foreach (var diagnostic in node.GetDiagnostics())
                {
                    yield return(SyntaxDiagnostic.From(diagnostic, position));
                }
            }

            for (var i = 0; i < node.Slots; i++)
            {
                var maybeChild = node.GetSlot(i);
                if (maybeChild is Internal.GreenNode child)
                {
                    foreach (var diagnostic in GetDiagnosticsRecursive(child, position))
                    {
                        yield return(diagnostic);
                    }

                    position += child.FullWidth;
                }
            }
        }
Exemplo n.º 2
0
 private protected SyntaxNode(Internal.GreenNode green, int position)
 {
     _parent  = this;
     _green   = green;
     Position = position;
 }
Exemplo n.º 3
0
 internal RootSyntaxNode(Internal.GreenNode green, int position) : base(green, position)
 {
 }
Exemplo n.º 4
0
 internal MethodDeclarationSyntaxNode(SyntaxNode parent, Internal.GreenNode green, int position) : base(parent, green, position)
 {
 }
Exemplo n.º 5
0
 internal FunctionHandleExpressionSyntaxNode(SyntaxNode parent, Internal.GreenNode green, int position) : base(parent, green, position)
 {
 }
Exemplo n.º 6
0
 internal StatementSyntaxNode(SyntaxNode parent, Internal.GreenNode green, int position) : base(parent, green, position)
 {
 }
Exemplo n.º 7
0
 internal SyntaxNode(SyntaxNode parent, Internal.GreenNode green, int position)
 {
     _parent  = parent;
     _green   = green;
     Position = position;
 }
Exemplo n.º 8
0
 internal SyntaxTrivia(SyntaxNode parent, Internal.GreenNode trivia)
 {
     _parent = parent;
     _trivia = trivia;
 }
Exemplo n.º 9
0
 internal SyntaxToken(SyntaxNode parent, Internal.GreenNode token, int position)
 {
     _parent  = parent;
     _token   = token ?? throw new ArgumentNullException(nameof(token));
     Position = position;
 }