Пример #1
0
        public SyntaxToken(SyntaxKind kind, string text, SyntaxNode leadingTrivia, SyntaxNode trailingTrivia)
            : base(kind)
        {
            Text = text;
            if (trailingTrivia != null)
            {
                _trailingTriviaOrTriviaInfo = trailingTrivia;
            }

            if (leadingTrivia != null)
            {
                _trailingTriviaOrTriviaInfo = TriviaInfo.Create(leadingTrivia, _trailingTriviaOrTriviaInfo as SyntaxNode);
            }
        }
Пример #2
0
        public SyntaxToken(SyntaxKind kind, string text, SyntaxNode leadingTrivia, SyntaxNode trailingTrivia)
            : base(kind, text.Length)
        {
            Text = text;
            if (trailingTrivia != null)
            {
                AdjustWidth(trailingTrivia);
                _trailingTriviaOrTriviaInfo = trailingTrivia;
            }

            if (leadingTrivia != null)
            {
                AdjustWidth(leadingTrivia);
                _trailingTriviaOrTriviaInfo = TriviaInfo.Create(leadingTrivia, _trailingTriviaOrTriviaInfo as SyntaxNode);
            }

            ClearFlagIfMissing();
        }