This implements a simple FileReader type that tracks files added to it with AddFile() and their number of source lines, and then lets you look up which file and file-line number a particular overall line number belongs to with FileLine().
It allows us to do away with errorFileLine and look up lines simply, without altering the parser or being invasive in that code.
Just a draft for comparing approaches. Needs comments and tests.
This implements a simple
FileReader
type that tracks files added to it withAddFile()
and their number of source lines, and then lets you look up which file and file-line number a particular overall line number belongs to withFileLine()
.It allows us to do away with
errorFileLine
and look up lines simply, without altering the parser or being invasive in that code.Just a draft for comparing approaches. Needs comments and tests.