From 53ba129d7d1f576125a81ba693b2ed0bfdee82d9 Mon Sep 17 00:00:00 2001 From: Softonik Date: Mon, 22 Jan 2024 04:06:18 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D1=86=D0=B5=D0=BD=D0=B0=D1=80=D0=B8?= =?UTF-8?q?=D0=B9:=20=D0=A1=D1=82=D1=80=D1=83=D0=BA=D1=82=D1=83=D1=80?= =?UTF-8?q?=D0=B0=20=D1=81=20=D0=BF=D0=BE=D0=BB=D1=8F=D0=BC=D0=B8=20=D0=BE?= =?UTF-8?q?=D0=B4=D0=BD=D0=BE=D0=B3=D0=BE=20=D1=82=D0=B8=D0=BF=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/service/features/app.feature | 17 +++++++++++++++++ pkg/service/type.go | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/pkg/service/features/app.feature b/pkg/service/features/app.feature index 53a8860..81aa2ec 100644 --- a/pkg/service/features/app.feature +++ b/pkg/service/features/app.feature @@ -42,4 +42,21 @@ class device { public: int a; }; +``` + + Сценарий: Структура с полями одного типа + * Исходник: +``` +package test + +type device struct { + a,b int +} +``` + * Результат: +``` +class device { +public: + int a,b; +}; ``` diff --git a/pkg/service/type.go b/pkg/service/type.go index f9f551c..06f9964 100644 --- a/pkg/service/type.go +++ b/pkg/service/type.go @@ -44,8 +44,13 @@ func handleField(f *ast.Field) string { code += " " code += handleIdentExpr(f.Type) code += " " + nado_zapyatuyu := false for _, n := range f.Names { + if nado_zapyatuyu { + code += "," + } code += handleIdentExpr(n) + nado_zapyatuyu = true } code += ";\n" return code