Documentation ¶
Index ¶
- Constants
- func AssignPath(dt *gen.DefinedTree, path path.TypePath, variable string, expr ast.Expression, ...) error
- func ConstantPath(expr ast.Expression) path.TypePath
- func ConstantString(expr ast.Expression) string
- func Convert(dmf *ast.File, packageName string, importPath string) (*gen.DefinedTree, error)
- func ConvertFiles(inputFiles []string, outputGo string, outputPack string, packageName string, ...) error
- func DefaultSrcSetting(tree *gen.DefinedTree, typePath path.TypePath) types.SrcSetting
- func DefinePath(dt *gen.DefinedTree, path path.TypePath) error
- func DefineProc(dt *gen.DefinedTree, typePath path.TypePath, isVerb bool, variable string, ...) error
- func DefineVar(dt *gen.DefinedTree, path path.TypePath, varType path.TypePath, ...) error
- func ExprToGo(expr ast.Expression, ctx CodeGenContext) (exprString string, etype dtype.DType, err error)
- func FuncBodyToGo(body []ast.Statement, ctx CodeGenContext) (lines []string, err error)
- func ImplementFunction(dt *gen.DefinedTree, path path.TypePath, function string, ...) error
- func MergeGoLines(lines []string) string
- func ParseSettings(dt *gen.DefinedTree, typePath path.TypePath, body []ast.Statement) (types.ProcSettings, []ast.Statement, error)
- func ParseSrcSetting(expr ast.Expression, stype ast.StatementType) (types.SrcSetting, error)
- func StatementToGo(statement ast.Statement, ctx CodeGenContext) (lines []string, err error)
- type CodeGenContext
- func (ctx CodeGenContext) ChunkName() string
- func (ctx CodeGenContext) ResolveNonLocal(name string) (get string, set func(to string) string, vtype dtype.DType, ok bool)
- func (ctx CodeGenContext) UseVar(v string)
- func (ctx CodeGenContext) UsrRef() string
- func (ctx CodeGenContext) WithVar(name string, varType dtype.DType) CodeGenContext
- type ResourceType
Constants ¶
View Source
const LocalVariablePrefix = "var"
Variables ¶
This section is empty.
Functions ¶
func AssignPath ¶
func AssignPath(dt *gen.DefinedTree, path path.TypePath, variable string, expr ast.Expression, loc tokenizer.SourceLocation) error
func ConstantPath ¶
func ConstantPath(expr ast.Expression) path.TypePath
func ConstantString ¶
func ConstantString(expr ast.Expression) string
func ConvertFiles ¶
func DefaultSrcSetting ¶
func DefaultSrcSetting(tree *gen.DefinedTree, typePath path.TypePath) types.SrcSetting
func DefinePath ¶
func DefinePath(dt *gen.DefinedTree, path path.TypePath) error
func DefineProc ¶
func DefineProc(dt *gen.DefinedTree, typePath path.TypePath, isVerb bool, variable string, loc tokenizer.SourceLocation) error
func DefineVar ¶
func DefineVar(dt *gen.DefinedTree, path path.TypePath, varType path.TypePath, variable string, loc tokenizer.SourceLocation) error
func ExprToGo ¶
func ExprToGo(expr ast.Expression, ctx CodeGenContext) (exprString string, etype dtype.DType, err error)
expressions should always produce a types.Value
func FuncBodyToGo ¶
func FuncBodyToGo(body []ast.Statement, ctx CodeGenContext) (lines []string, err error)
func ImplementFunction ¶
func ImplementFunction(dt *gen.DefinedTree, path path.TypePath, function string, arguments []ast.ProcArgument, body []ast.Statement, loc tokenizer.SourceLocation) error
func MergeGoLines ¶
func ParseSettings ¶
func ParseSrcSetting ¶
func ParseSrcSetting(expr ast.Expression, stype ast.StatementType) (types.SrcSetting, error)
func StatementToGo ¶
func StatementToGo(statement ast.Statement, ctx CodeGenContext) (lines []string, err error)
Types ¶
type CodeGenContext ¶
type CodeGenContext struct { WorldRef string Tree *gen.DefinedTree VarTypes map[string]dtype.DType VarsUsed map[string]struct{} Result string ThisProc string DefIndex uint }
func (CodeGenContext) ChunkName ¶
func (ctx CodeGenContext) ChunkName() string
func (CodeGenContext) ResolveNonLocal ¶
func (CodeGenContext) UseVar ¶
func (ctx CodeGenContext) UseVar(v string)
func (CodeGenContext) UsrRef ¶
func (ctx CodeGenContext) UsrRef() string
func (CodeGenContext) WithVar ¶
func (ctx CodeGenContext) WithVar(name string, varType dtype.DType) CodeGenContext
type ResourceType ¶
type ResourceType int
const ( ResourceTypeNone ResourceType = iota ResourceTypeIcon ResourceTypeAudio )
func ResourceTypeByName ¶
func ResourceTypeByName(name string) ResourceType
Click to show internal directories.
Click to hide internal directories.