const classafPlastic::SrcCodeSnippet

sys::Obj
  afPlastic::SrcCodeSnippet

Generates snippets of source code, often used to report errors.

make

Source

new make(Uri srcCodeLocation, Str srcCode)

Creates a SrcCodeSnippet.

srcCode

Source

const Str[] srcCode

A list of source code lines.

srcCodeLocation

Source

const Uri srcCodeLocation

An arbitrary uri of where the source code originated from.

srcCodeSnippet

Source

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 extra linesOfPadding.

srcCodeSnippetMap

Source

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 extra linesOfPadding.

toStr

Source

virtual override Str toStr()