Example #1
0
        internal static WithThreeChildren List(GreenNode child0, GreenNode child1, GreenNode child2)
        {
            RoslynDebug.Assert(child0 != null);
            RoslynDebug.Assert(child1 != null);
            RoslynDebug.Assert(child2 != null);

            int       hash;
            GreenNode?cached = SyntaxNodeCache.TryGetNode(
                GreenNode.ListKind,
                child0,
                child1,
                child2,
                out hash
                );

            if (cached != null)
            {
                return((WithThreeChildren)cached);
            }

            var result = new WithThreeChildren(child0, child1, child2);

            if (hash >= 0)
            {
                SyntaxNodeCache.AddNode(result, hash);
            }

            return(result);
        }
Example #2
0
        internal static WithThreeChildren List(GreenNode child0, GreenNode child1, GreenNode child2)
        {
            Debug.Assert(child0 != null);
            Debug.Assert(child1 != null);
            Debug.Assert(child2 != null);

            var result = new WithThreeChildren(child0, child1, child2);

            return(result);
        }
        internal static WithThreeChildren List(CSharpSyntaxNode child0, CSharpSyntaxNode child1, CSharpSyntaxNode child2)
        {
            Debug.Assert(child0 != null);
            Debug.Assert(child1 != null);
            Debug.Assert(child2 != null);

            int hash;
            GreenNode cached = SyntaxNodeCache.TryGetNode((short)SyntaxKind.List, child0, child1, child2, out hash);
            if (cached != null)
                return (WithThreeChildren)cached;

            var result = new WithThreeChildren(child0, child1, child2);
            if (hash >= 0)
            {
                SyntaxNodeCache.AddNode(result, hash);
            }

            return result;
        }
Example #4
0
        internal static WithThreeChildren List(CSharpSyntaxNode child0, CSharpSyntaxNode child1, CSharpSyntaxNode child2)
        {
            Debug.Assert(child0 != null);
            Debug.Assert(child1 != null);
            Debug.Assert(child2 != null);

            int       hash;
            GreenNode cached = SyntaxNodeCache.TryGetNode((short)SyntaxKind.List, child0, child1, child2, out hash);

            if (cached != null)
            {
                return((WithThreeChildren)cached);
            }

            var result = new WithThreeChildren(child0, child1, child2);

            if (hash >= 0)
            {
                SyntaxNodeCache.AddNode(result, hash);
            }

            return(result);
        }
Example #5
0
        internal static WithThreeChildren List(SyntaxNode child0, SyntaxNode child1, SyntaxNode child2)
        {
            var result = new WithThreeChildren(child0, child1, child2);

            return(result);
        }
 internal static WithThreeChildren List(SyntaxNode child0, SyntaxNode child1, SyntaxNode child2)
 {
     var result = new WithThreeChildren(child0, child1, child2);
     return result;
 }