Documentation
¶
Index ¶
- Variables
- func MakePythonLanguage(cfg *Config) (language.Language, error)
- type Config
- type DirectoryResult
- type FileResult
- type InitModuleResult
- type Language
- func (l *Language) ParseExports(file *language.FileInfo) (*language.ExportsResult, error)
- func (l *Language) ParseFile(id string) (*language.FileInfo, error)
- func (l *Language) ParseImports(file *language.FileInfo) (*language.ImportsResult, error)
- func (l *Language) ResolveAbsolute(slices []string, currDir string) *ResolveResult
- type ResolveResult
Constants ¶
This section is empty.
Variables ¶
View Source
var Extensions = []string{
"py",
"pyi",
"pyx",
}
Functions ¶
Types ¶
type DirectoryResult ¶
type FileResult ¶
type FileResult struct {
Path string
}
type InitModuleResult ¶
type Language ¶
type Language struct {
// contains filtered or unexported fields
}
func (*Language) ParseExports ¶
func (*Language) ParseImports ¶
func (*Language) ResolveAbsolute ¶
func (l *Language) ResolveAbsolute(slices []string, currDir string) *ResolveResult
ResolveAbsolute never fails, if nothing is found it just returns nil.
This is fine because we assume that an un-resolved absolute import is pointing to a library or something like that, so no need to take it into account.
type ResolveResult ¶
type ResolveResult struct { InitModule *InitModuleResult Directory *DirectoryResult File *FileResult }
func ResolveRelative ¶
func ResolveRelative(slices []string, dir string, stepsBack int) (*ResolveResult, error)
ResolveRelative cannot return an empty []string, unless an error happened.
In contrary to ResolveAbsolute, this method can return an error as a relative import is always expected to be found.
Click to show internal directories.
Click to hide internal directories.