const classafPlastic::SrcCodeSnippet
sys::Obj afPlastic::SrcCodeSnippet
Generates snippets of source code, often used to report errors.
- make
new make(Uri srcCodeLocation, Str srcCode)
Creates a SrcCodeSnippet.
- srcCode
const Str[] srcCode
A list of source code lines.
- srcCodeLocation
const Uri srcCodeLocation
An arbitrary uri of where the source code originated from.
- srcCodeSnippet
Str srcCodeSnippet(Int lineNo, Str? msg := null, Int linesOfPadding := 5)
Returns a snippet of source code, centred on
lineNo
and padded on either side by an extralinesOfPadding
.- srcCodeSnippetMap
Int:Str srcCodeSnippetMap(Int lineNo, Int linesOfPadding := 5)
Returns a map of line numbers to source code, centred on
lineNo
and padded on either side by an extralinesOfPadding
.- toStr
virtual override Str toStr()