コード例 #1
0
            public override void VisitToken(SyntaxToken token)
            {
                // trivia is not considered, only the raw form of the token

                this.hash = Hash.Combine((int)token.CSharpKind(), this.hash);

                switch (token.CSharpKind())
                {
                case SyntaxKind.IdentifierToken:
                    this.hash = Hash.Combine(token.ValueText.GetHashCode(), this.hash);
                    break;

                case SyntaxKind.NumericLiteralToken:
                case SyntaxKind.CharacterLiteralToken:
                case SyntaxKind.StringLiteralToken:
                    this.hash = Hash.Combine(token.ToString().GetHashCode(), this.hash);
                    break;
                }
            }