48 lines
2.1 KiB
C#
48 lines
2.1 KiB
C#
using Microsoft.CodeAnalysis.Syntax.InternalSyntax;
|
|||
|
|
|
||
|
|
namespace Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax;
|
||
|
|
|
||
|
|
internal static class CSharpSyntaxNodeCache
|
||
|
|
{
|
||
|
|
internal static GreenNode TryGetNode(int kind, GreenNode child1, SyntaxFactoryContext context, out int hash)
|
||
|
|
{
|
||
|
|
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
return SyntaxNodeCache.TryGetNode(kind, child1, GetNodeFlags(context), ref hash);
|
||
|
|
}
|
||
|
|
|
||
|
|
internal static GreenNode TryGetNode(int kind, GreenNode child1, GreenNode child2, SyntaxFactoryContext context, out int hash)
|
||
|
|
{
|
||
|
|
//IL_0004: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
return SyntaxNodeCache.TryGetNode(kind, child1, child2, GetNodeFlags(context), ref hash);
|
||
|
|
}
|
||
|
|
|
||
|
|
internal static GreenNode TryGetNode(int kind, GreenNode child1, GreenNode child2, GreenNode child3, SyntaxFactoryContext context, out int hash)
|
||
|
|
{
|
||
|
|
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
return SyntaxNodeCache.TryGetNode(kind, child1, child2, child3, GetNodeFlags(context), ref hash);
|
||
|
|
}
|
||
|
|
|
||
|
|
private static NodeFlags GetNodeFlags(SyntaxFactoryContext context)
|
||
|
|
{
|
||
|
|
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
NodeFlags val = SyntaxNodeCache.GetDefaultNodeFlags();
|
||
|
|
if (context.IsInAsync)
|
||
|
|
{
|
||
|
|
val = (NodeFlags)(val | 0x40);
|
||
|
|
}
|
||
|
|
if (context.IsInQuery)
|
||
|
|
{
|
||
|
|
val = (NodeFlags)(val | 0x80);
|
||
|
|
}
|
||
|
|
return val;
|
||
|
|
}
|
||
|
|
}
|