public SyntaxKind GetKind()
 {
     if (Kind != SyntaxKind.None)
     {
         return(Kind);
     }
     return(SyntaxFacts.GetTypeDeclarationKind(TameSyntaxFacts.SyntaxKindFromStr(KeywordStr)));
 }
示例#2
0
            static SyntaxNode?TryFindContainingReturnableConstruct(SyntaxNode?node)
            {
                while (node is not null && !node.IsReturnableConstruct())
                {
                    if (SyntaxFacts.GetTypeDeclarationKind(node.Kind()) != SyntaxKind.None)
                    {
                        return(null);
                    }

                    node = node.Parent;
                }

                return(node);
            }
示例#3
0
            static SyntaxNode?TryFindContinuableConstruct(SyntaxNode?node)
            {
                while (node is not null && !node.IsContinuableConstruct())
                {
                    var kind = node.Kind();

                    if (node.IsReturnableConstruct() ||
                        SyntaxFacts.GetTypeDeclarationKind(kind) != SyntaxKind.None)
                    {
                        return(null);
                    }

                    node = node.Parent;
                }

                return(node);
            }