diff --git a/transpile_python/service.go b/transpile_python/service.go index b8433f8..c70a8bb 100644 --- a/transpile_python/service.go +++ b/transpile_python/service.go @@ -472,6 +472,8 @@ func handleSelectorExpr(expr ast.Expr) string { s := expr.(*ast.SelectorExpr) code := "" switch x := s.X.(type) { + case *ast.SelectorExpr: + code += handleSelectorExpr(x) case *ast.Ident: code += handleIdent(x) } diff --git a/transpile_python/service_test.go b/transpile_python/service_test.go index 96dbfab..111faf8 100644 --- a/transpile_python/service_test.go +++ b/transpile_python/service_test.go @@ -151,6 +151,23 @@ main() Compare(source, expected) }) + It("Deep property assign", func() { + source := `package test + import "skidl" + + func main() { + a.b.c = 1 + } + ` + expected := `from skidl import * + +def main(): + a.b.c = 1 +main() +` + Compare(source, expected) + }) + It("Function Declaration", func() { source := `package test import "skidl"