Esempio n. 1
0
LocationTable::LocationTable(const PreprocessedContents& contents)
  : m_positionAtLastOffset(EMPTY_CACHE)
{
  anchor(0, Anchor(0,0), 0);

  const unsigned int newline = indexFromCharacter('\n');
  int line = 0;

  for (std::size_t i = 0; i < (std::size_t)contents.size(); ++i)
    if (contents.at(i) == newline)
      anchor(i + 1, Anchor(++line, 0), 0);
}