From c591e38ddb00cb6ebd54e913621c86818cea8c17 Mon Sep 17 00:00:00 2001 From: Softonik Date: Sat, 17 Dec 2022 01:27:57 +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=D0=BE=D0=B1=D0=B0=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D0=BE=D0=B5=20=D0=BE=D0=B1=D1=8A=D1=8F=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BC=D0=B0=D1=81=D1=81=D0=B8=D0=B2=D0=B0?= 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 | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/transpile_python/service.go b/transpile_python/service.go index 301f941..a2a6c49 100644 --- a/transpile_python/service.go +++ b/transpile_python/service.go @@ -703,6 +703,8 @@ func handleValueSpecValues(values []ast.Expr) string { switch v := value.(type) { case *ast.BasicLit: code += handleBasicLit(v) + case *ast.CompositeLit: + code += handleCompositeLit(v) case *ast.BinaryExpr: code += handleBinaryExpr(v) case *ast.SelectorExpr: diff --git a/transpile_python/service_test.go b/transpile_python/service_test.go index b0d6192..4af55bb 100644 --- a/transpile_python/service_test.go +++ b/transpile_python/service_test.go @@ -117,6 +117,20 @@ def main(): t = True o = True main() +` + Compare(source, expected) + }) + + It("Array declaration", func() { + source := `package test + import . "skidl" + + var a = []any{} + ` + expected := `from skidl import * + +a = [] + ` Compare(source, expected) })