mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-17 19:23:25 +00:00
tgo: Allow anonymous function declarations
Not sure why they're needed right now, though...
This commit is contained in:
@@ -392,6 +392,14 @@ func (c *Compiler) parsePackage(program *ssa.Program, pkg *ssa.Package) error {
|
|||||||
if member.Synthetic == "package initializer" {
|
if member.Synthetic == "package initializer" {
|
||||||
c.initFuncs = append(c.initFuncs, frame.llvmFn)
|
c.initFuncs = append(c.initFuncs, frame.llvmFn)
|
||||||
}
|
}
|
||||||
|
// TODO: recursively anonymous functions
|
||||||
|
for _, child := range member.AnonFuncs {
|
||||||
|
frame, err := c.parseFuncDecl(child)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
frames[child] = frame
|
||||||
|
}
|
||||||
case *ssa.NamedConst:
|
case *ssa.NamedConst:
|
||||||
// Ignore package-level untyped constants. The SSA form doesn't need
|
// Ignore package-level untyped constants. The SSA form doesn't need
|
||||||
// them.
|
// them.
|
||||||
|
|||||||
Reference in New Issue
Block a user