From 207627c428481910bd06c09895f8e44183153e31 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Thu, 16 Oct 2025 21:59:53 -0400 Subject: [PATCH] generate: Fix spacing and comment issues --- generate/generate.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/generate/generate.go b/generate/generate.go index 96a0722..97f73bf 100644 --- a/generate/generate.go +++ b/generate/generate.go @@ -20,7 +20,6 @@ const preamble = ` // The source file is located at // Please edit that file instead, and re-compile it to this location. // HOPP, TAPE, METADAPT, PDL/0 (c) 2025 holanet.xyz - ` const static = ` @@ -58,6 +57,7 @@ func boolInt(input bool) int { } } +// ensure ucontainer is always imported var _ hopp.Option[int] ` @@ -184,7 +184,7 @@ func (this *Generator) generateTypedef(name string, typedef Typedef) (n int, err // DecodeValue method nn, err = this.iprintf( - "\n // DecodeValue decodes the value of this type without " + + "\n// DecodeValue decodes the value of this type without " + "the tag. The value is\n// decoded according to the " + "parameters specified by the tag, if possible.\n") n += nn; if err != nil { return n, err } @@ -1140,8 +1140,10 @@ func (this *Generator) generateTypeTableDefined(typ TypeTableDefined) (n int, er for _, key := range slices.Sorted(maps.Keys(typ.Fields)) { field := typ.Fields[key] - nn, err := this.iprintf("%s\n", this.formatComment(field.Doc)) - n += nn; if err != nil { return n, err } + if field.Doc != "" { + nn, err := this.iprintf("%s\n", this.formatComment(field.Doc)) + n += nn; if err != nil { return n, err } + } nn, err = this.iprintf("%s ", field.Name) n += nn; if err != nil { return n, err } if field.Option {