private bool TryGetTokenization(int line, out LineTokenization tokenization) { tokenization = _map[line]; if (tokenization.Tokens != null) { return(true); } tokenization = default(LineTokenization); return(false); }
internal LineTokenizationMap Clone() { lock (_lock) { LineTokenization[] map = null; if (_map != null) { map = new LineTokenization[_map.Length]; Array.Copy(map, _map, map.Length); } return(new LineTokenizationMap(map)); } }
/// <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> private int IndexOfPreviousTokenization(int line, int minLine, out LineTokenization tokenization) { line--; while (line >= minLine) { if (_map[line].Tokens != null) { tokenization = _map[line]; return(line); } line--; } tokenization = default(LineTokenization); return(minLine - 1); }