Documentation
¶
Overview ¶
Package packages provides utility functions to statically analyze Gno MemPackages
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileImport ¶
type FileImport struct { PkgPath string Spec *ast.ImportSpec }
FileImport represents an import
func FileImports ¶
FileImports returns the list of gno imports in the given file src. The given filename is only used when recording position information.
type FileKind ¶
type FileKind uint
FileKind represent the category a gno source file falls in, can be one of:
- FileKindPackageSource -> A *.gno file that will be included in the gnovm package
- FileKindTest -> A *_test.gno file that will be used for testing
- FileKindXTest -> A *_test.gno file with a package name ending in _test that will be used for blackbox testing
- FileKindFiletest -> A *_filetest.gno file that will be used for snapshot testing
type ImportsMap ¶
type ImportsMap map[FileKind][]FileImport
func Imports ¶
func Imports(pkg *gnovm.MemPackage, fset *token.FileSet) (ImportsMap, error)
Imports returns the list of gno imports from a gnovm.MemPackage. fset is optional.
func (ImportsMap) Merge ¶
func (imap ImportsMap) Merge(kinds ...FileKind) []FileImport
Merge merges imports, it removes duplicates and sorts the result