new parser works

This commit is contained in:
Araq 2013-04-20 18:46:08 +02:00
commit 03764f0aba
4 changed files with 66 additions and 39 deletions

View file

@ -786,8 +786,9 @@ proc sourceLine*(i: TLineInfo): PRope =
for line in lines(i.toFullPath):
addSourceLine i.fileIndex, line.string
InternalAssert i.fileIndex < fileInfos.len and
i.line <= fileInfos[i.fileIndex].lines.len
InternalAssert i.fileIndex < fileInfos.len
# can happen if the error points to EOF:
if i.line > fileInfos[i.fileIndex].lines.len: return nil
result = fileInfos[i.fileIndex].lines[i.line-1]