Documentation
¶
Index ¶
- type Builder
- type CodeFile
- type Config
- type ExportEntry
- type ExportName
- type ExportsEntries
- type ExportsResult
- type FileCacheKey
- type FileInfo
- type Graph
- type ImportEntry
- type ImportsCacheKey
- type ImportsResult
- type Language
- type Node
- type NodeParser
- type NodeParserBuilder
- type Parser
- type TestFile
- type TestLanguage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 ExportsEntries ¶ added in v0.17.4
type ExportsEntries 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 ExportsResult ¶
type FileCacheKey ¶
type FileCacheKey string
type ImportEntry ¶
type ImportEntry struct { // All: if all the names from Path are imported. All bool // Names: what specific names form Path are imported. Names []string // Path: from where are the names imported. Path string }
func AllImport ¶ added in v0.17.4
func AllImport(path string) ImportEntry
func EmptyImport ¶ added in v0.17.4
func EmptyImport(path string) ImportEntry
func NamesImport ¶ added in v0.17.4
func NamesImport(names []string, path string) 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[F CodeFile] 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) // 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) (*ExportsEntries, error) // Display takes an absolute path to a file and displays it nicely. Display(path string) string }
type NodeParser ¶ added in v0.17.4
type NodeParser = dep_tree.NodeParser[FileInfo]
type NodeParserBuilder ¶ added in v0.17.4
type NodeParserBuilder = dep_tree.NodeParserBuilder[FileInfo]
func ParserBuilder ¶
func ParserBuilder[F CodeFile, C any](languageBuilder Builder[F, C], langCfg C, generalCfg Config) NodeParserBuilder
type TestLanguage ¶
type TestLanguage struct {
// contains filtered or unexported fields
}
func (*TestLanguage) Display ¶ added in v0.19.0
func (t *TestLanguage) Display(id string) string
func (*TestLanguage) ParseExports ¶
func (t *TestLanguage) ParseExports(file *TestFile) (*ExportsEntries, error)
func (*TestLanguage) ParseImports ¶
func (t *TestLanguage) ParseImports(file *TestFile) (*ImportsResult, error)
Click to show internal directories.
Click to hide internal directories.