question

package
v0.0.0-...-9cab0d1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenAssginStmt

func GenAssginStmt(assignVar, assignToken, call string) string

func GenErrorHandler

func GenErrorHandler(resultPkg, resultVar, retType string) string

func GenNoneHandler

func GenNoneHandler(optionPkg, optionVar, retType string) string

func GenUnwrapExpr

func GenUnwrapExpr(receiverVar string) string

func GenUnwrapStmt

func GenUnwrapStmt(assignVar, assignToken, receiverVar string) string

func GenerateQuestionSyntax

func GenerateQuestionSyntax(info *lib.FileInfo[*QuestionSyntax], writer io.Writer) error

Types

type QImplType

type QImplType struct {
	MainType  string
	InnerType string
}

type QuestionCall

type QuestionCall struct {
	lib.Extent
	Expr        *lib.Extent
	AssignVar   *lib.Extent
	AssignToken string
	ExprType    string
	OuterStmt   *lib.Extent
}

type QuestionInstanceType

type QuestionInstanceType struct {
	Name string
}

func (*QuestionInstanceType) String

func (m *QuestionInstanceType) String() string

type QuestionSyntax

type QuestionSyntax struct {
	Call    *QuestionCall
	OuterFn string
	RetType *QImplType
}

func (*QuestionSyntax) String

func (m *QuestionSyntax) String() string

type QuestionSyntaxInspector

type QuestionSyntaxInspector struct {
	// contains filtered or unexported fields
}

func NewQuestionSyntaxInspector

func NewQuestionSyntaxInspector(pkg *packages.Package, instances []*QuestionInstanceType) *QuestionSyntaxInspector

func (*QuestionSyntaxInspector) Inspect

func (i *QuestionSyntaxInspector) Inspect(n ast.Node, stack []ast.Node) (syntax *QuestionSyntax)

func (*QuestionSyntaxInspector) Nodes

func (i *QuestionSyntaxInspector) Nodes() []ast.Node

type QuestionTypeInspector

type QuestionTypeInspector struct {
	// contains filtered or unexported fields
}

func NewQuestionTypeInspector

func NewQuestionTypeInspector(pkg *packages.Package) *QuestionTypeInspector

func (*QuestionTypeInspector) Inspect

type Translator

type Translator struct{}

func (*Translator) Generate

func (*Translator) Generate(info *lib.FileInfo[*QuestionSyntax], writer io.Writer) error

func (*Translator) InpectTypes

func (*Translator) InpectTypes(p *packages.Package) []*QuestionInstanceType

func (*Translator) InspectSyntax

func (*Translator) Run

func (t *Translator) Run(ctx context.Context, rootDir string, firstRun bool) error

Jump to

Keyboard shortcuts

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