Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LineKeeper ¶
type LineKeeper struct { EOLLocations []int // end-of-line locations // contains filtered or unexported fields }
LineKeeper keeps track of line numberson a textual source file and can map character location to the relevant `code.Position`
func (*LineKeeper) GetPositionFromCharacterIndex ¶
func (lk *LineKeeper) GetPositionFromCharacterIndex(pos int) code.Position
GetPositionFromCharacterIndex returns the `code.Position` given the index of the character in the file
type PathConsumer ¶ added in v0.0.4
type PathConsumer interface { Consume(path string) diagnostics.WhitelistProvider }
PathConsumer is a sink for paths and URIs
type PathMultiplexer ¶ added in v0.0.4
type PathMultiplexer interface { SetPathConsumers(consumers ...PathConsumer) ConsumePath(path string) }
PathMultiplexer interface defines an aggregator of analysers that can consume filesystem paths and URIs and process them
func NewPathMultiplexer ¶ added in v0.0.4
func NewPathMultiplexer(consumers ...PathConsumer) PathMultiplexer
NewPathMultiplexer creates a choreographer that orchestrates the consumption of paths by consumers
type PositionProvider ¶
PositionProvider provides a "global" view of code location, given an arbitrary character index.
type SourceConsumer ¶
type SourceConsumer interface { //Consume allows a source processor receive `source` data streamed in "chunks", with `startIndex` indicating the //character location of the first character in the stream Consume(startIndex int, source string) SetLineKeeper(*LineKeeper) //ShouldProvideSourceInDiagnostics toggles whether source evidence should be provided with diagnostics, defaults to false ShouldProvideSourceInDiagnostics(bool) //used to signal to the consumer that the source stream has ended End() }
SourceConsumer is a sink for streaming source
type SourceMultiplexer ¶
type SourceMultiplexer interface { //SetSource is the source reader to multiplex to multiple consumers, which will be provided with a copy of the source data as it is being streamed in from the source SetSourceAndConsumers(source *io.Reader, provideSourceInDiagnostics bool, consumers ...SourceConsumer) }
SourceMultiplexer interface defines a source reader that can be multiplexed to multiple consumers. It provides additional utility such as mapping a source index to the line and character, i.e. the `code.Position` in the source
func NewSourceMultiplexer ¶
func NewSourceMultiplexer(source *io.Reader, provideSource bool, consumers ...SourceConsumer) SourceMultiplexer
NewSourceMultiplexer creates a source multiplexer over an input reader