Documentation
¶
Overview ¶
This packages implement functions to read the source map format described in the "Source Map Revision 3 Proposal" available at http://goo.gl/bcVlcK
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct { GeneratedColumn int // 0-based column of this entry in the generated source. SourceFileId int // Index of the source file in the "sources" list. SourceLine int // 0-based line number of this entry in the source file. SourceColumn int // 0-based column number of this entry in the source file. NameId int // Index of the symbol name in the "names" list. }
Represents a section of the generated source that can be mapped back to the original source.
type Line ¶
type Line []Entry
Represents a line in the generated source. A line is composed of entries containing information about the original source file.
type OriginalMapping ¶
type OriginalMapping struct { File string // The filename of the original file. Line int // 1-based line number. Column int // 1-based column number. Name string // The symbol name, if any. }
Represents the mapping to a line/column/name in the original file.
type SourceMap ¶
type SourceMap struct { Version int File string SourceRoot string Sources []string SourcesContent []string Names []string Mappings []Line }
A struct representing the decoded source map.
func (*SourceMap) GetSourceMapping ¶
func (s *SourceMap) GetSourceMapping(linum, column int) (mapping OriginalMapping, err error)
Given a line and a column number in the generated code, find a mapping in the original source. The line and column parameters are 1-based. If no mapping can be found for a given line, a mapping on the previous line is returned.
Directories
¶
Path | Synopsis |
---|---|
Program that reads a source map from stdin and finds the original mapping for the given line and column numbers in the generated source.
|
Program that reads a source map from stdin and finds the original mapping for the given line and column numbers in the generated source. |