Beispiel #1
0
        internal bool TryGetTokenization(int line, out LineTokenization tokenization)
        {
            Debug.Assert(line >= 0);
            Debug.Assert(_map != null);

            if (_map[line].Tokens != null)
            {
                tokenization = _map[line];
                return(true);
            }
            else
            {
                tokenization = default(LineTokenization);
                return(false);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Looks for the first cached tokenization preceding the given line.
        /// Returns the line we have a tokenization for or minLine - 1 if there is none.
        /// </summary>
        internal int IndexOfPreviousTokenization(int line, int minLine, out LineTokenization tokenization)
        {
            Debug.Assert(line >= 0);
            Debug.Assert(_map != null);

            line--;
            while (line >= minLine)
            {
                if (_map[line].Tokens != null)
                {
                    tokenization = _map[line];
                    return(line);
                }
                line--;
            }
            tokenization = default(LineTokenization);
            return(minLine - 1);
        }
Beispiel #3
0
        internal bool TryGetTokenization(int line, out LineTokenization tokenization)
        {
            Debug.Assert(line >= 0);
            Debug.Assert(_map != null);

            if (_map[line].Tokens != null) {
                tokenization = _map[line];
                return true;
            } else {
                tokenization = default(LineTokenization);
                return false;
            }
        }
Beispiel #4
0
        /// <summary>
        /// Looks for the first cached tokenization preceding the given line.
        /// Returns the line we have a tokenization for or minLine - 1 if there is none.
        /// </summary>
        internal int IndexOfPreviousTokenization(int line, int minLine, out LineTokenization tokenization)
        {
            Debug.Assert(line >= 0);
            Debug.Assert(_map != null);

            line--;
            while (line >= minLine) {
                if (_map[line].Tokens != null) {
                    tokenization = _map[line];
                    return line;
                }
                line--;
            }
            tokenization = default(LineTokenization);
            return minLine - 1;
        }