From 086f87df05653b98997ab2035f59b457ba07c9ef Mon Sep 17 00:00:00 2001 From: Softonik Date: Thu, 8 Dec 2022 05:07:15 +0300 Subject: [PATCH] =?UTF-8?q?Python:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D0=B3=D0=BB=D1=83=D0=B1=D0=BE=D0=BA=D0=BE?= =?UTF-8?q?=D0=B5=20=D0=BE=D0=B1=D1=80=D0=B0=D1=89=D0=B5=D0=BD=D0=B8=D0=B5?= =?UTF-8?q?=20=D0=BA=20=D1=81=D0=B2=D0=BE=D0=B9=D1=81=D1=82=D0=B2=D0=B0?= =?UTF-8?q?=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- transpile_python/service.go | 2 ++ transpile_python/service_test.go | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) 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"