import * as files from "." ; /** represents a location inside the document base, i.e. a line inside a file */ export class Location { file : files . FullFilePath ; line : number ; sourceDir : files . SourceDir ; constructor ( sourceDir , file , line ) { this . sourceDir = sourceDir ; this . file = file ; this . line = line ; } /** provides an empty location for testing */ static scaffold ( ) { return new Location ( new files . SourceDir ( "" ) , new files . FullFilePath ( "" ) , 0 ) ; } /** provides the absolute path to the file in this location */ absoluteFilePath ( ) { return this . sourceDir . joinFullFile ( this . file ) ; } /** provides a copy of this Location with the given file */ withFile ( file ) { return new Location ( this . sourceDir , file , this . line ) ; } /** provides a copy of this Location with the given line */ withLine ( line ) { return new Location ( this . sourceDir , this . file , line ) ; } }