A map of line offsets into the source character sequence and a count of how many lines are present.
A map of line offsets into the source character sequence and a count of how many lines are present. The line offset map is indexed starting at zero and contains at least one entry.
The content of the source.
The content of the source.
A map of line offsets into the source character sequence and a count of how many lines are present.
A map of line offsets into the source character sequence and a count of how many lines are present. The line offset map is indexed starting at zero and contains at least one entry.
Return the offset after the last character of a line.
Return the offset after the last character of a line.
A map of line offsets into the source character sequence and a count of how many lines are present.
A map of line offsets into the source character sequence and a count of how many lines are present. The line offset map is indexed starting at zero and contains at least one entry.
The name of this source.
The name of this source.
Convert an offset into the content into a position.
Convert an offset into the content into a position.
If the given line number is within range for this source, return
the content of that line, otherwise return None
.
If the given line number is within range for this source, return
the content of that line, otherwise return None
. As a special
case, support a line beyond the end of the input which contains
nothing since parsers
If the position is valid for this source, return the corresponding
offset into the content, otherwise return None
.
If the position is valid for this source, return the corresponding
offset into the content, otherwise return None
.
Return a reader on this source.
Return a reader on this source. Not normally used by Kiama but useful if you want to use a source with other code that requires a reader.
Run a function using this source as a file.
Run a function using this source as a file. The content of the source will be
in the file and the name of the file will be passed to fn
.
A source that is a named file.