gen

package module
v0.0.0-...-c0f82f5 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CodeHeader = "// Code generated by genlua."

Variables

This section is empty.

Functions

func CheckHeader

func CheckHeader(fname, s string) error

func GenGetCode

func GenGetCode(vtype, vname string, idx int, isStar, udataToBytes bool) string

func GenLua

func GenLua(filename string, in []byte, formatCode bool) ([]byte, error)

func GenPushCode

func GenPushCode(sprefix, vtype, vname string, idx int,
	isStar, isSlice bool, sliceType string, makeUdata bool) string

func ParseDoc

func ParseDoc(cg *ast.CommentGroup) (name, prefix string, makeUdata, udataToBytes, ok bool)

func ParseFunc

func ParseFunc(sprefix string, fd *ast.FuncDecl, idx int, makeUdata bool, udataToBytes bool) ([]string, []string,
	[]CodeItem, []CodeItem, string)

func ParseTag

func ParseTag(tag string) string

func ParseTypeDoc

func ParseTypeDoc(cg *ast.CommentGroup) bool

Types

type Code

type Code struct {
	FileName     string
	CodeHeader   string
	PkgName      string
	StructPrefix string
	StructName   string
	ModuleName   string
	Imports      []PkgImport

	Funcs []CodeFunc

	Fields []CodeField

	TypeFuncs []CodeFunc
}

type CodeField

type CodeField struct {
	FieldName string
	Name      string
	Code      string
}

type CodeFunc

type CodeFunc struct {
	StructName string

	IsType  bool
	StartID string

	FuncID     string
	FuncName   string
	FuncPrefix string

	ResultList []string
	ParamList  []string

	Params  []CodeItem
	Results []CodeItem
}

type CodeItem

type CodeItem struct {
	Name string
	Code string
}

type PkgImport

type PkgImport struct {
	Name   string
	Import string
}

Jump to

Keyboard shortcuts

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