示例#1
0
 /// <nodoc />
 private LineInfo([NotNull] LineMap map, int position)
     : this()
 {
     Contract.Requires(map != null);
     m_map      = map;
     m_position = position;
 }
示例#2
0
        private void ComputeLineAndColumnIfNeeded()
        {
            if (m_map != null)
            {
                var lineAndColumn = Scanner.ExpensiveComputeLineAndCharacterOfPositionSeeTask646652(m_map.Map, m_position);

                m_position = lineAndColumn.Character;
                m_line     = lineAndColumn.Line;

                m_map = null;
            }
        }
示例#3
0
        /// <summary>
        /// Reads a line info using the provided reader
        /// </summary>
        /// <remarks>
        /// If the line info was originally stored in unexpanded form, then the provided line map is used
        /// to construct the instance.
        /// </remarks>
        public static LineInfo Read(LineMap lineMap, BuildXLReader reader)
        {
            var isUnexpanded = reader.ReadBoolean();

            if (isUnexpanded)
            {
                var absolutePosition = reader.ReadInt32Compact();
                return(FromLineMap(lineMap, absolutePosition));
            }

            int line     = reader.ReadInt32Compact();
            int position = reader.ReadInt32Compact();

            return(FromLineAndPosition(line, position));
        }
示例#4
0
 /// <nodoc />
 public static LineInfo FromLineMap([NotNull] LineMap map, int position)
 {
     return(new LineInfo(map, position));
 }