VBF.Compilers.Scanners.Lexeme.SetTrivia C# (CSharp) Method

SetTrivia() private method

private SetTrivia ( IReadOnlyList trivia ) : void
trivia IReadOnlyList
return void
        internal void SetTrivia(IReadOnlyList<Lexeme> trivia)
        {
            m_trivia = trivia;
        }

Usage Example

Ejemplo n.º 1
0
Archivo: Scanner.cs Proyecto: zgf/VBF
        private void AddHistory(Lexeme lexeme, bool setTrivia = true)
        {
            Debug.Assert(m_valuableCursor == m_valuableHistory.Count);

            m_fullHistory.Add(lexeme);
            int fullCursor = m_fullHistory.Count();

            if (setTrivia)
            {
                int lastTriviaStartIndex = m_lastNotSkippedLexemeIndex + 1;
                int lastTriviaLength     = fullCursor - 1 - lastTriviaStartIndex;

                if (lastTriviaLength < 0)
                {
                    lastTriviaLength = 0;
                }

                lexeme.SetTrivia(new LexemeRange(m_fullHistory, lastTriviaStartIndex, lastTriviaLength));
                m_lastNotSkippedLexemeIndex = fullCursor - 1;

                m_valuableHistory.Add(fullCursor - 1);
                m_valuableCursor = m_valuableHistory.Count;
            }
        }
All Usage Examples Of VBF.Compilers.Scanners.Lexeme::SetTrivia