diff --git a/build/global.go b/build/global.go index 162ca7e..39b58bf 100644 --- a/build/global.go +++ b/build/global.go @@ -122,6 +122,9 @@ func Store(src reg.Register, dst gotypes.Component) { ctx.Store(src, dst) } // Dereference loads a pointer and returns its element type. func Dereference(ptr gotypes.Component) gotypes.Component { return ctx.Dereference(ptr) } +// Function starts building a new function with the given name. +func Function(name string) { ctx.Function(name) } + // Doc sets documentation comment lines for the currently active function. func Doc(lines ...string) { ctx.Doc(lines...) } @@ -131,6 +134,9 @@ func Pragma(directive string, args ...string) { ctx.Pragma(directive, args...) } // Attributes sets function attributes for the currently active function. func Attributes(a attr.Attribute) { ctx.Attributes(a) } +// SignatureExpr parses the signature expression and sets it as the active function's signature. +func SignatureExpr(expr string) { ctx.SignatureExpr(expr) } + // Implement starts building a function of the given name, whose type is // specified by a stub in the containing package. func Implement(name string) { ctx.Implement(name) }