public SyntaxKind GetKind() { if (Kind != SyntaxKind.None) { return(Kind); } return(SyntaxFacts.GetTypeDeclarationKind(TameSyntaxFacts.SyntaxKindFromStr(KeywordStr))); }
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); }
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); }