ParentToThis<TSyntaxNode, TExpected>(ref TSyntaxNode?, TSyntaxNode?, Boolean, TExpected) Method

Definition

Namespace Tomlyn.Syntax
Assembly Tomlyn.dll

Helper method to deparent/parent a SyntaxToken to this instance with an expected kind of token condition.

protected void ParentToThis<TSyntaxNode, TExpected>(ref TSyntaxNode? set, TSyntaxNode? node, bool expectedKindSuccess, TExpected expectedMessage)
    where TSyntaxNode : SyntaxToken

Type parameters

TSyntaxNode
Type of the node
TExpected
The type of message

Parameters

set
{TSyntaxNode}

The previous child node parented to this instance

node
{TSyntaxNode}

The new child node to parent to this instance

expectedKindSuccess
Boolean

true if kind is matching, false otherwise

expectedMessage
{TExpected}

The message to display if the kind is not matching