/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Compilers/CSharp/Portable/Syntax/InternalSyntax/SyntaxToken.SyntaxIdentifier.cs
65 строк
2 KB
Cyrus Najmabadi
Update generators
06 окт 2023, 20:20
06 окт 2023, 20:20
6fb6240
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax { internal partial class SyntaxToken { internal class SyntaxIdentifier : SyntaxToken { protected readonly string TextField; internal SyntaxIdentifier(string text) : base(SyntaxKind.IdentifierToken, text.Length) { this.TextField = text; } internal SyntaxIdentifier(string text, DiagnosticInfo[] diagnostics, SyntaxAnnotation[] annotations) : base(SyntaxKind.IdentifierToken, text.Length, diagnostics, annotations) { this.TextField = text; } public override string Text { get { return this.TextField; } } public override object Value { get { return this.TextField; } } public override string ValueText { get { return this.TextField; } } public override SyntaxToken TokenWithLeadingTrivia(GreenNode trivia) { return new SyntaxIdentifierWithTrivia(this.Kind, this.TextField, this.TextField, trivia, null, this.GetDiagnostics(), this.GetAnnotations()); } public override SyntaxToken TokenWithTrailingTrivia(GreenNode trivia) { return new SyntaxIdentifierWithTrivia(this.Kind, this.TextField, this.TextField, null, trivia, this.GetDiagnostics(), this.GetAnnotations()); } internal override GreenNode SetDiagnostics(DiagnosticInfo[] diagnostics) { return new SyntaxIdentifier(this.Text, diagnostics, this.GetAnnotations()); } internal override GreenNode SetAnnotations(SyntaxAnnotation[] annotations) { return new SyntaxIdentifier(this.Text, this.GetDiagnostics(), annotations); } } } }