typepkg

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Locator

type Locator struct {
	// contains filtered or unexported fields

} // struct size: 32 bytes; struct align: 8 bytes; struct aligned size: 32 bytes; - 🌺 gopium @1pkg

Locator defines abstraction that helps encapsulate pkgs token.FileSets and provides some operations on top of it

func NewLocator

func NewLocator(fset *token.FileSet) *Locator

NewLocator creates new locator instance from provided file set

func (*Locator) Fset

func (l *Locator) Fset(loc string, fset *token.FileSet) (*token.FileSet, bool)

Fset multifunc method that either set new fset for location or returns child fset if any

func (*Locator) ID

func (l *Locator) ID(p token.Pos) string

ID calculates sha256 hash hex string for specified token.Pos in token.FileSet note: generated ids are ordered inside same loc

func (*Locator) Loc

func (l *Locator) Loc(p token.Pos) string

Loc returns full filepath for specified token.Pos in token.FileSet

func (*Locator) Locator

func (l *Locator) Locator(loc string) (gopium.Locator, bool)

Locator returns child locator if any

func (*Locator) Root

func (l *Locator) Root() *token.FileSet

Root just returns root token.FileSet back

type MavenGoTypes

type MavenGoTypes struct {
	// contains filtered or unexported fields

} // struct size: 32 bytes; struct align: 8 bytes; struct aligned size: 32 bytes; - 🌺 gopium @1pkg

MavenGoTypes defines maven default "go/types" implementation that uses types.Sizes Sizeof in order to get type info

func NewMavenGoTypes

func NewMavenGoTypes(compiler, arch string, caches ...int64) (MavenGoTypes, error)

NewMavenGoTypes creates instance of MavenGoTypes and requires compiler and arch for types.Sizes initialization

func (MavenGoTypes) Align

func (m MavenGoTypes) Align(t types.Type) int64

Align MavenGoTypes implementation

func (MavenGoTypes) Name

func (m MavenGoTypes) Name(t types.Type) string

Name MavenGoTypes implementation

func (MavenGoTypes) Size

func (m MavenGoTypes) Size(t types.Type) int64

Size MavenGoTypes implementation

func (MavenGoTypes) SysAlign

func (m MavenGoTypes) SysAlign() int64

SysAlign MavenGoTypes implementation

func (MavenGoTypes) SysCache

func (m MavenGoTypes) SysCache(level uint) int64

SysCache MavenGoTypes implementation

func (MavenGoTypes) SysWord

func (m MavenGoTypes) SysWord() int64

SysWord MavenGoTypes implementation

type ParserXToolPackagesAst

type ParserXToolPackagesAst struct {
	BuildEnv   []string          `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1,comment_struct_annotate,add_tag_group_force"`
	BuildFlags []string          `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1,comment_struct_annotate,add_tag_group_force"`
	Pattern    string            `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1,comment_struct_annotate,add_tag_group_force"`
	Path       string            `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1,comment_struct_annotate,add_tag_group_force"`
	Root       string            `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1,comment_struct_annotate,add_tag_group_force"`
	ModeTypes  packages.LoadMode `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1,comment_struct_annotate,add_tag_group_force"`
	ModeAst    parser.Mode       `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1,comment_struct_annotate,add_tag_group_force"`
	// contains filtered or unexported fields

} // struct size: 128 bytes; struct align: 8 bytes; struct aligned size: 128 bytes; - 🌺 gopium @1pkg

ParserXToolPackagesAst defines gopium parser default implementation that uses "golang.org/x/tools/go/packages" to collect package types and "go/parser" to collect ast package

Note: ParserXToolPackagesAst is big struct so it should be passed via pointer

func (*ParserXToolPackagesAst) ParseAst

func (p *ParserXToolPackagesAst) ParseAst(ctx context.Context, src ...byte) (*ast.Package, gopium.Locator, error)

ParseAst ParserXToolPackagesAst implementation

func (*ParserXToolPackagesAst) ParseTypes

func (p *ParserXToolPackagesAst) ParseTypes(ctx context.Context, _ ...byte) (*types.Package, gopium.Locator, error)

ParseTypes ParserXToolPackagesAst implementation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL