Each source must have a definite name, and each line read is counted. This allows references to the original source to be generated in the code (and documentation) files, so that errors reported by language processors can be corrected. The code files cannot be edited, because they are generated by Interscript and any changes would be overwritten by the next processing run.
A related reason for source tracking is to generate cross reference tables. For example some tanglers generate an identifier cross reference, which can be used, for example, to disentangle duplicated names. The tables can also be used to generate vi editor tags, for example.
Every line of output must have an associated original source. That includes code that is saved temporarily (in memory, or to a disk file), and it includes generated code.
In order to accurately track original source lines, each input driver must have a name, usually the input file name, and must count lines read. When a line is read by the parser, the filename and line number are returned as well. The parser passes this information on to the relevant processor, usually the executor, tangler, or weaver.
In turn, the tangler, for example, will check the sink driver to see if the otput is synchronised with the original source, and then store the source filename and line number in the sink driver.
If since the last write to the sink, not necessarily by this tangler, the original source filename has changed, or the line number is not one more than last time, then a section header is written to the sink file before the data. In C and C++ a #line directive is generated, in languages not supporting such directives (such as HTML and Python), a comment is generated instead. (Coincidentally, many scripting languages use a leading # for a comment and so the C style #line directives is generated)