mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-22 08:47:28 +01:00
Stop dumbindent collapsing consecutive blank lines
This commit is contained in:
1 parent
ed48514f30
commit
58c0862c50
4 files changed
+39
-20
No files matched your search
+10
-2
@@ -679,13 +679,17 @@ func (g *gen) genHeader(b *buffer) error {
|
||||
|
||||
b.writes("// ---------------- Status Codes\n\n")
|
||||
|
||||
wroteStatus := false
|
||||
for _, z := range g.statusList {
|
||||
if !z.fromThisPkg || !z.public {
|
||||
continue
|
||||
}
|
||||
b.printf("extern const char* %s;\n", z.cName)
|
||||
wroteStatus = true
|
||||
}
|
||||
if wroteStatus {
|
||||
b.writes("\n")
|
||||
}
|
||||
b.writes("\n")
|
||||
|
||||
b.writes("// ---------------- Public Consts\n\n")
|
||||
if err := g.forEachConst(b, pubOnly, (*gen).writeConst); err != nil {
|
||||
@@ -782,13 +786,17 @@ func (g *gen) genImpl(b *buffer) error {
|
||||
|
||||
b.writes("// ---------------- Status Codes Implementations\n\n")
|
||||
|
||||
wroteStatus := false
|
||||
for _, z := range g.statusList {
|
||||
if !z.fromThisPkg || z.msg == "" {
|
||||
continue
|
||||
}
|
||||
b.printf("const char* %s = \"%s%s: %s\";\n", z.cName, z.msg[:1], g.pkgName, z.msg[1:])
|
||||
wroteStatus = true
|
||||
}
|
||||
if wroteStatus {
|
||||
b.writes("\n")
|
||||
}
|
||||
b.writes("\n")
|
||||
|
||||
b.writes("// ---------------- Private Consts\n\n")
|
||||
if err := g.forEachConst(b, priOnly, (*gen).writeConst); err != nil {
|
||||
|
||||
@@ -368,10 +368,13 @@ func (g *gen) writeFuncImplPrologue(b *buffer) error {
|
||||
b.writes("\n")
|
||||
|
||||
// Generate the local variables.
|
||||
oldLenB := len(*b)
|
||||
if err := g.writeVars(b, &g.currFunk, false); err != nil {
|
||||
return err
|
||||
}
|
||||
b.writes("\n")
|
||||
if oldLenB != len(*b) {
|
||||
b.writes("\n")
|
||||
}
|
||||
|
||||
if g.currFunk.derivedVars != nil {
|
||||
for _, o := range g.currFunk.astFunc.In().Fields() {
|
||||
|
||||
Reference in new issue
Block a user