Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
 - func TryGetSourceMappingURL(lineInfo *ECMALineInfo) string
 - type DocumentPosition
 - type DocumentPositionMapper
 - type ECMALineInfo
 - type Generator
 - func (gen *Generator) AddGeneratedMapping(generatedLine int, generatedCharacter int) error
 - func (gen *Generator) AddName(name string) NameIndex
 - func (gen *Generator) AddNamedSourceMapping(generatedLine int, generatedCharacter int, sourceIndex SourceIndex, ...) error
 - func (gen *Generator) AddSource(fileName string) SourceIndex
 - func (gen *Generator) AddSourceMapping(generatedLine int, generatedCharacter int, sourceIndex SourceIndex, ...) error
 - func (gen *Generator) RawSourceMap() *RawSourceMap
 - func (gen *Generator) SetSourceContent(sourceIndex SourceIndex, content string) error
 - func (gen *Generator) Sources() []string
 - func (gen *Generator) String() string
 
- type Host
 - type MappedPosition
 - type Mapping
 - type MappingsDecoder
 - type NameIndex
 - type RawSourceMap
 - type Source
 - type SourceIndex
 - type SourceMappedPosition
 
Constants ¶
      View Source
      
  
const ( MissingSource SourceIndex = -1 MissingName NameIndex = -1 MissingLineOrColumn int = -1 )
Variables ¶
This section is empty.
Functions ¶
func TryGetSourceMappingURL ¶
func TryGetSourceMappingURL(lineInfo *ECMALineInfo) string
Tries to find the sourceMappingURL comment at the end of a file.
Types ¶
type DocumentPosition ¶
type DocumentPositionMapper ¶
type DocumentPositionMapper struct {
	// contains filtered or unexported fields
}
    Maps source positions to generated positions and vice versa.
func GetDocumentPositionMapper ¶
func GetDocumentPositionMapper(host Host, generatedFileName string) *DocumentPositionMapper
func (*DocumentPositionMapper) GetGeneratedPosition ¶
func (d *DocumentPositionMapper) GetGeneratedPosition(loc *DocumentPosition) *DocumentPosition
func (*DocumentPositionMapper) GetSourcePosition ¶
func (d *DocumentPositionMapper) GetSourcePosition(loc *DocumentPosition) *DocumentPosition
type ECMALineInfo ¶
type ECMALineInfo struct {
	// contains filtered or unexported fields
}
    func CreateECMALineInfo ¶
func CreateECMALineInfo(text string, lineStarts core.ECMALineStarts) *ECMALineInfo
func (*ECMALineInfo) LineCount ¶
func (li *ECMALineInfo) LineCount() int
func (*ECMALineInfo) LineText ¶
func (li *ECMALineInfo) LineText(line int) string
type Generator ¶
type Generator struct {
	// contains filtered or unexported fields
}
    func NewGenerator ¶
func (*Generator) AddGeneratedMapping ¶
Adds a mapping without source information
func (*Generator) AddNamedSourceMapping ¶
func (gen *Generator) AddNamedSourceMapping(generatedLine int, generatedCharacter int, sourceIndex SourceIndex, sourceLine int, sourceCharacter int, nameIndex NameIndex) error
Adds a mapping with source and name information
func (*Generator) AddSource ¶
func (gen *Generator) AddSource(fileName string) SourceIndex
Adds a source to the source map
func (*Generator) AddSourceMapping ¶
func (gen *Generator) AddSourceMapping(generatedLine int, generatedCharacter int, sourceIndex SourceIndex, sourceLine int, sourceCharacter int) error
Adds a mapping with source information
func (*Generator) RawSourceMap ¶
func (gen *Generator) RawSourceMap() *RawSourceMap
Gets the source map as a `RawSourceMap` object
func (*Generator) SetSourceContent ¶
func (gen *Generator) SetSourceContent(sourceIndex SourceIndex, content string) error
Sets the content for a source
type MappedPosition ¶
type MappedPosition struct {
	// contains filtered or unexported fields
}
    Similar to `Mapping`, but position-based.
type Mapping ¶
type Mapping struct {
	GeneratedLine      int
	GeneratedCharacter int
	SourceIndex        SourceIndex
	SourceLine         int
	SourceCharacter    int
	NameIndex          NameIndex
}
    func (*Mapping) IsSourceMapping ¶
type MappingsDecoder ¶
type MappingsDecoder struct {
	// contains filtered or unexported fields
}
    func DecodeMappings ¶
func DecodeMappings(mappings string) *MappingsDecoder
func (*MappingsDecoder) Error ¶
func (d *MappingsDecoder) Error() error
func (*MappingsDecoder) MappingsString ¶
func (d *MappingsDecoder) MappingsString() string
func (*MappingsDecoder) Next ¶
func (d *MappingsDecoder) Next() (value *Mapping, done bool)
func (*MappingsDecoder) Pos ¶
func (d *MappingsDecoder) Pos() int
func (*MappingsDecoder) State ¶
func (d *MappingsDecoder) State() *Mapping
type RawSourceMap ¶
type SourceIndex ¶
type SourceIndex int
type SourceMappedPosition ¶
type SourceMappedPosition = MappedPosition
 Click to show internal directories. 
   Click to hide internal directories.