Documentation
¶
Overview ¶
Package sourcemap maps positions in emitted Go back to .gpp source.
Because emission is text-edit-based (intra-line splices plus inserted header/marker lines) and then gofmt-formatted, a line-level diff between source and output recovers an accurate mapping: unchanged lines map exactly, spliced lines map with line fidelity, inserted lines attribute to the nearest preceding mapped line.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map struct {
GppPath string
// contains filtered or unexported fields
}
Map maps one emitted file's positions to its .gpp source.
func (*Map) Forward ¶ added in v0.9.0
Forward maps a .gpp position to its emitted counterpart — the inverse direction, built from the same line pairing (the first emitted line attributed to the .gpp line wins; columns carry over on exact lines and clamp to column 1 otherwise). ok is false for .gpp lines with no emitted counterpart.