Documentation
¶
Index ¶
- func ParserBuilder[T any, F any](languageBuilder Builder[T, F]) dep_tree.NodeParserBuilder[T]
- type Builder
- type ExportEntry
- type ExportName
- type ExportsCacheKey
- type ExportsResult
- type FileCacheKey
- type ImportEntry
- type ImportsCacheKey
- type ImportsResult
- type Language
- type Parser
- func (p *Parser[T, F]) CachedParseExports(ctx context.Context, filePath string) (context.Context, *ExportsResult, error)
- func (p *Parser[T, F]) CachedParseFile(ctx context.Context, id string) (context.Context, *F, error)
- func (p *Parser[T, F]) CachedParseImports(ctx context.Context, id string) (context.Context, *ImportsResult, error)
- func (p *Parser[T, F]) CachedUnwrappedParseExports(ctx context.Context, id string) (context.Context, *UnwrappedExportsResult, error)
- func (p *Parser[T, F]) Deps(ctx context.Context, n *graph.Node[T]) (context.Context, []*graph.Node[T], error)
- func (p *Parser[T, F]) Display(n *graph.Node[T]) string
- func (p *Parser[T, F]) Entrypoint() (*graph.Node[T], error)
- type TestFile
- type TestLanguage
- type TestLanguageData
- type UnwrappedExportsCacheKey
- type UnwrappedExportsResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParserBuilder ¶
func ParserBuilder[T any, F any](languageBuilder Builder[T, F]) dep_tree.NodeParserBuilder[T]
Types ¶
type ExportEntry ¶
type ExportEntry struct { // All: all the names from Path are exported. All bool // Names: exported specific names from Path. Names []ExportName // Path: absolute path from where they are exported, it might be from the same file or from another. Path string }
type ExportName ¶
type ExportsCacheKey ¶
type ExportsCacheKey string
type ExportsResult ¶
type ExportsResult struct { // Exports: array of ExportEntry // NOTE: even though it could work returning a path relative to the file, it should return absolute. Exports []ExportEntry // Errors: errors while parsing exports. Errors []error }
type FileCacheKey ¶
type FileCacheKey string
type ImportEntry ¶
type ImportsCacheKey ¶
type ImportsCacheKey string
type ImportsResult ¶
type ImportsResult struct { // Imports: ordered map from absolute imported path to the array of names that where imported. // if one of the names is *, then all the names are imported Imports []ImportEntry // Errors: errors while parsing imports. Errors []error }
type Language ¶
type Language[T any, F any] interface { // ParseFile receives an absolute file path and returns F, where F is the specific file implementation // defined by the language. This file object F will be used as input for parsing imports and exports. ParseFile(path string) (*F, error) // MakeNode receives an absolute file path and returns a graph.Node implementation. MakeNode(path string) (*graph.Node[T], error) // ParseImports receives the file F parsed by the ParseFile method and gathers the imports that the file // F contains. ParseImports(file *F) (*ImportsResult, error) // ParseExports receives the file F parsed by the ParseFile method and gathers the exports that the file // F contains. ParseExports(file *F) (*ExportsResult, error) }
type Parser ¶
func (*Parser[T, F]) CachedParseExports ¶
func (*Parser[T, F]) CachedParseFile ¶
func (*Parser[T, F]) CachedParseImports ¶
func (*Parser[T, F]) CachedUnwrappedParseExports ¶
type TestLanguage ¶
type TestLanguage struct {
// contains filtered or unexported fields
}
func (*TestLanguage) MakeNode ¶
func (t *TestLanguage) MakeNode(id string) (*graph.Node[TestLanguageData], error)
func (*TestLanguage) ParseExports ¶
func (t *TestLanguage) ParseExports(file *TestFile) (*ExportsResult, error)
func (*TestLanguage) ParseImports ¶
func (t *TestLanguage) ParseImports(file *TestFile) (*ImportsResult, error)
type TestLanguageData ¶
type TestLanguageData struct{}
type UnwrappedExportsCacheKey ¶
type UnwrappedExportsCacheKey string
type UnwrappedExportsResult ¶
Click to show internal directories.
Click to hide internal directories.