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