From db8dbb6abb421a4fa385c6cfc17353b61dccd44a Mon Sep 17 00:00:00 2001 From: Chris O'Hara Date: Sat, 16 Dec 2023 12:46:48 +1000 Subject: [PATCH] Skip synthetic functions --- compiler/compile.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/compile.go b/compiler/compile.go index 9a09f4f..2e94145 100644 --- a/compiler/compile.go +++ b/compiler/compile.go @@ -199,6 +199,9 @@ func (c *compiler) compile(path string) error { } } if pkg == nil { + if fn.Synthetic != "" { + continue + } return fmt.Errorf("unsupported yield function %s (Pkg is nil)", fn) } @@ -320,7 +323,7 @@ func (c *compiler) compilePackage(p *packages.Package, colors functionColors) er case *ast.FuncDecl: case *ast.FuncLit: default: - return fmt.Errorf("unsupported yield function %s (Syntax is %T, not *ast.FuncDecl or *ast.FuncLit)", fn, decl) + continue } colorsByFunc[decl] = color }