/// <summary> /// Determines if the two nodes or tokens are equivalent. /// </summary> public bool IsEquivalentTo(SyntaxNodeOrToken other) { if (this.IsNode != other.IsNode) { return(false); } GreenNode thisUnderlying = this.UnderlyingNode; GreenNode otherUnderlying = other.UnderlyingNode; return((thisUnderlying == otherUnderlying) || (thisUnderlying != null && thisUnderlying.IsEquivalentTo(otherUnderlying))); }
/// <summary> /// Determines if this token is equivalent to the specified token. /// </summary> public bool IsEquivalentTo(SyntaxToken token) { return ((_token == null && token.Node == null) || (_token != null && token.Node != null && _token.IsEquivalentTo(token.Node))); }
/// <summary> /// Determines if this trivia is equivalent to the specified trivia. /// </summary> public bool IsEquivalentTo(SyntaxTrivia trivia) { return ((_triviaNode == null && trivia.UnderlyingNode == null) || (_triviaNode != null && trivia.UnderlyingNode != null && _triviaNode.IsEquivalentTo(trivia.UnderlyingNode))); }