parser

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAstUnexpected  = errors.New("ast contained unexpected data")
	ErrAstUnsupported = errors.New("ast contained unsupported data")
	ErrInternal       = errors.New("internal error")
)

Functions

func IsErrorType

func IsErrorType(t Type) bool

Types

type ArrayType

type ArrayType struct {
	Inner Type
}

func (*ArrayType) String

func (t *ArrayType) String() string

type FuncDef

type FuncDef struct {
	Name string
	Sig  *FuncType
	Recv UsageMode
}

type FuncType

type FuncType struct {
	Params  []*Slot
	Results []*Slot
}

func (*FuncType) String

func (t *FuncType) String() string

type IdentType

type IdentType struct {
	Name string
}

func (*IdentType) String

func (t *IdentType) String() string

type Package

type Package struct {
	PkgPath   string
	TypeOrder []string
	Types     map[string]*TypeDef
	FuncOrder []string
	Funcs     map[string]*FuncDef
}

func Parse

func Parse(path string, printAST bool) (*Package, error)

type PointerType

type PointerType struct {
	Inner Type
}

func (*PointerType) String

func (t *PointerType) String() string

type Slot

type Slot struct {
	Name string
	Type Type
}

type StructType

type StructType struct {
	Fields []*Slot
}

func (*StructType) String

func (t *StructType) String() string

type Type

type Type interface {
	String() string
	// contains filtered or unexported methods
}

type TypeDef

type TypeDef struct {
	Name      string
	Type      Type
	Usage     UsageMode
	FuncOrder []string
	Funcs     map[string]*FuncDef
}

type UsageMode

type UsageMode string
const (
	UsageModeNone  UsageMode = ""
	UsageModeValue UsageMode = "value"
	UsageModeRef   UsageMode = "ref"
)

Jump to

Keyboard shortcuts

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