コード例 #1
0
        /// <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)));
        }
コード例 #2
0
ファイル: SyntaxToken.cs プロジェクト: yonifra/roslyn
 /// <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)));
 }
コード例 #3
0
ファイル: SyntaxTrivia.cs プロジェクト: yonifra/roslyn
 /// <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)));
 }