diff --git a/transpile_python/service.go b/transpile_python/service.go index a0985a2..67ab295 100644 --- a/transpile_python/service.go +++ b/transpile_python/service.go @@ -176,6 +176,7 @@ func handleBinaryExpr(expr ast.Expr) string { } func handleCallExpr(expr *ast.CallExpr) string { + // spew.Dump(expr) func_name := handleExpr(expr.Fun) code := "" switch func_name { @@ -477,6 +478,11 @@ func handleSelectorExpr(expr ast.Expr) string { code += handleSelectorExpr(x) case *ast.Ident: code += handleIdent(x) + case *ast.CallExpr: + code += handleCallExpr(x) + default: + spew.Dump(s) + code += "unknown handleSelectorExpr" } code += "." code += handleIdent(s.Sel) diff --git a/transpile_python/service_test.go b/transpile_python/service_test.go index 8665513..cc786f6 100644 --- a/transpile_python/service_test.go +++ b/transpile_python/service_test.go @@ -228,6 +228,23 @@ main() Compare(source, expected) }) + FIt("Sequence func call", func() { + source := `package test + import . "skidl" + + func main() { + a.b().c(1).d(2).e(3) + } + ` + expected := `from skidl import * + +def main(): + a.b().c(1).d(2).e(3) +main() +` + Compare(source, expected) + }) + It("Func return", func() { source := `package test import . "skidl"