vts

package
v0.0.0-...-7b96089 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	// DeclarationType represents the type of the field declaration.
	DeclarationType TypeName

	// Name represents the name of the field.
	Name string

	// Type represents the type of the field.
	Type TypeName
}

Field represents a field in a type.

func (*Field) GetDeclarationType

func (f *Field) GetDeclarationType() TypeName

func (*Field) GetName

func (f *Field) GetName() string

type Method

type Method struct {
	DeclarationType TypeName
	Name            string

	Parameters []Parameter
	Results    []Parameter

	TypeParameters []Parameter
}

func (*Method) GetDeclarationType

func (m *Method) GetDeclarationType() TypeName

func (*Method) GetName

func (m *Method) GetName() string

func (*Method) String

func (m *Method) String() string

type Package

type Package struct {
	Name  PackageName
	Types []*Type
	// contains filtered or unexported fields
}

func (*Package) ResolveType

func (p *Package) ResolveType(name string) *Type

ResolveType resolves a type by name within the package. It searches for a type with a matching name in the package's list of types. If a matching type is found, it returns a pointer to the type. Otherwise, it returns nil.

func (*Package) String

func (p *Package) String() string

type PackageName

type PackageName string

type Parameter

type Parameter struct {
	Name string
	Type TypeName
}

type Scope

type Scope struct {
	Packages map[PackageName]*Package
	Types    map[TypeName]*Type
}

func NewScope

func NewScope() *Scope

NewScope returns a new instance of Scope. It creates an empty scope with initialized maps for Packages and Types.

func (*Scope) AddPackage

func (s *Scope) AddPackage(pkg *Package)

type Type

type Type struct {
	Name TypeName

	Members []TypeMember
}

type TypeMember

type TypeMember interface {
	GetName() string
	GetDeclarationType() TypeName
}

type TypeName

type TypeName struct {
	Pkg  PackageName
	Name string
}

func (*TypeName) String

func (tn *TypeName) String() string

Jump to

Keyboard shortcuts

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