summaryrefslogtreecommitdiff
path: root/protoReformat.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-03-27 06:26:01 -0500
committerJeff Carr <[email protected]>2025-03-27 06:26:01 -0500
commit1b7d44ec42bc5be8f07bb67c0fbbddf36f2e3050 (patch)
tree9fc2157180c98e1b1d3493516ec73394343d2fbf /protoReformat.go
parentebf856a579281c4aea7630d3cc712adac5bb21d7 (diff)
add an enum for messages
Diffstat (limited to 'protoReformat.go')
-rw-r--r--protoReformat.go47
1 files changed, 24 insertions, 23 deletions
diff --git a/protoReformat.go b/protoReformat.go
index d54ece1..adb9764 100644
--- a/protoReformat.go
+++ b/protoReformat.go
@@ -49,17 +49,15 @@ func protoReformat(filename string) error {
var newfile string
- /*
- _, junk := filepath.Split(filename)
- if junk != "SignalService.proto" {
- var allLinesIter iter.Seq[string]
- allLinesIter = makeLineIter(data)
- // gets the max vartype and varname
- for line := range allLinesIter {
- newfile += fmt.Sprintln(commentPreprocessor(line))
- }
- return saveFile(filename, newfile)
- }
+ /* check the comment preprocessor
+ log.Info("filename", filename)
+ alltest := makeLineIter(data)
+ // gets the max vartype and varname
+ for line := range alltest {
+ newfile += fmt.Sprintln(commentPreprocessor(line))
+ }
+ saveFile(filename, newfile)
+ os.Exit(-1)
*/
var fmtmsg *FormatMsg
@@ -374,23 +372,25 @@ func formatMessage(curmsg *FormatMsg) []string {
}
*/
- for _, msg := range curmsg.Enums {
- for _, newline := range formatEnum(msg) {
- newmsg = append(newmsg, newline)
+ /*
+ for _, msg := range curmsg.Enums {
+ for _, newline := range formatEnum(msg) {
+ newmsg = append(newmsg, newline)
+ }
}
- }
- for _, msg := range curmsg.Oneofs {
- for _, newline := range formatEnum(msg) {
- newmsg = append(newmsg, newline)
+ for _, msg := range curmsg.Oneofs {
+ for _, newline := range formatEnum(msg) {
+ newmsg = append(newmsg, newline)
+ }
}
- }
- for _, msg := range curmsg.InceptionMsgs {
- for _, newline := range formatMessage(msg) {
- newmsg = append(newmsg, newline)
+ for _, msg := range curmsg.Msgs {
+ for _, newline := range msg.format() {
+ newmsg = append(newmsg, newline)
+ }
}
- }
+ */
for _, line := range curmsg.Lines {
line = strings.TrimSpace(line)
@@ -452,6 +452,7 @@ func (it *LinesScanner) Next() string {
}
// out := commentPreprocessor(it.things[it.index-1])
out := it.things[it.index-1]
+ out = commentPreprocessor(out)
// return strings.TrimSpace(out)
return out
}