整理打印

This commit is contained in:
2025-10-03 00:54:22 +08:00
parent bff7f73d8b
commit 73480005eb
6 changed files with 63 additions and 3 deletions
+8
View File
@@ -124,6 +124,14 @@ func parseFunctions(lines []string, exportedFunctions map[string]bool) []ErlangF
inFunction = false
currentFunction = ErlangFunction{}
}
// 函数结束条件:行以 ; 结束,且括号和花括号匹配
if strings.HasSuffix(trimmedLine, ";") && braceCount == 0 && parenCount == 0 {
currentFunction.EndLine = i + 1
functions = append(functions, currentFunction.ParseComments())
inFunction = false
currentFunction = ErlangFunction{}
}
} else {
// 不在函数中时,遇到非注释行就清空注释缓存
if trimmedLine != "" && !strings.HasPrefix(trimmedLine, "%") {