decl

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: BSD-3-Clause Imports: 8 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alias

type Alias struct {
	Name    string
	Comment string
	Type    expression.Type
}

func (*Alias) ASTDecl

func (a *Alias) ASTDecl() ast.Decl

type Const

type Const struct {
	Values []*spec.Value
}

func NewConst

func NewConst(values ...*spec.Value) *Const

func NewConstSingleValue

func NewConstSingleValue(name string, typ expression.Type, value astgen.ASTExpr) *Const

func (*Const) ASTDecl

func (c *Const) ASTDecl() ast.Decl

type Function

type Function struct {
	Name     string
	FuncType expression.FuncType
	Body     []astgen.ASTStmt
	Comment  string
}

func (*Function) ASTDecl

func (f *Function) ASTDecl() ast.Decl

type Import

type Import struct {
	Alias string
	Path  string
}

type Imports

type Imports []*Import

func NewImports

func NewImports(importsToAliases map[string]string) Imports

func (Imports) ASTDecl

func (s Imports) ASTDecl() ast.Decl

type Interface

type Interface struct {
	Name          string
	InterfaceType expression.InterfaceType
	Comment       string
}

func (*Interface) ASTDecl

func (i *Interface) ASTDecl() ast.Decl

type Method

type Method struct {
	Function
	ReceiverName string
	ReceiverType expression.Type
}

func (*Method) ASTDecl

func (m *Method) ASTDecl() ast.Decl

type Struct

type Struct struct {
	Name       string
	StructType expression.StructType
	Comment    string
}

func NewStruct

func NewStruct(name string, fields expression.StructFields, comment string) *Struct

func (*Struct) ASTDecl

func (s *Struct) ASTDecl() ast.Decl

type Var

type Var struct {
	Name  string
	Type  expression.Type
	Value astgen.ASTExpr
}

func NewVar

func NewVar(name string, typ expression.Type) *Var

func (*Var) ASTDecl

func (v *Var) ASTDecl() ast.Decl

type Vars added in v0.1.1

type Vars struct {
	Values []*spec.Value
}

func (*Vars) ASTDecl added in v0.1.1

func (c *Vars) ASTDecl() ast.Decl

Jump to

Keyboard shortcuts

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