fix(format): separate an empty TEXT body from the next block
The one-blank rule before a new block skipped every line that followed a TEXT directive, not just the function's first label, so a TEXT with an empty body ran straight into the next declaration. The exemption now applies to labels only, and the directive shapes around GLOBL and DATA ranges are pinned. Assisted-by: GLM 5.3
This commit is contained in:
1 parent
21b6348dbe
commit
71cc65ea48
2 files changed
+26
-1
No files matched your search
+1
-1
@@ -226,7 +226,7 @@ func normalizeSpacing(outs []outLine) string {
|
||||
switch prev := outs[j-1]; {
|
||||
case prev.kind == kBlank, prev.kind == kLabel:
|
||||
continue // already separated, or stacked labels
|
||||
case prev.kind == kDirective && strings.HasPrefix(prev.text, "TEXT"):
|
||||
case prev.kind == kDirective && strings.HasPrefix(prev.text, "TEXT") && ol.kind == kLabel:
|
||||
continue // the function's first label
|
||||
}
|
||||
insert[j] = true
|
||||
|
||||
Reference in new issue
Block a user