/// <summary> /// Should only be called during construction. /// </summary> /// <remarks> /// This should probably be an extra constructor parameter, but we don't need more constructor overloads. /// </remarks> protected void SetFactoryContext(SyntaxFactoryContext context) { if (context.IsInAsync) { this.flags |= NodeFlags.FactoryContextIsInAsync; } if (context.IsInQuery) { this.flags |= NodeFlags.FactoryContextIsInQuery; } }
internal static NodeFlags SetFactoryContext(NodeFlags flags, SyntaxFactoryContext context) { if (context.IsInAsync) { flags |= NodeFlags.FactoryContextIsInAsync; } if (context.IsInQuery) { flags |= NodeFlags.FactoryContextIsInQuery; } return(flags); }
private static GreenNode.NodeFlags GetNodeFlags(SyntaxFactoryContext context) { var flags = SyntaxNodeCache.GetDefaultNodeFlags(); if (context.IsInAsync) { flags |= GreenNode.NodeFlags.FactoryContextIsInAsync; } if (context.IsInQuery) { flags |= GreenNode.NodeFlags.FactoryContextIsInQuery; } return(flags); }
internal static GreenNode TryGetNode(int kind, GreenNode child1, SyntaxFactoryContext context, out int hash) { return(SyntaxNodeCache.TryGetNode(kind, child1, GetNodeFlags(context), out hash)); }