diff options
| author | Jeff Carr <[email protected]> | 2025-01-09 15:29:27 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-09 15:29:27 -0600 |
| commit | 455377e30abc161bbee3ee75ac81754a73405617 (patch) | |
| tree | e603a5f1b85f705ceb087396b7ac6abaccbf573c /protoParse.go | |
| parent | ff1721c250420fb4f1ce24f13d2e20721e40a07b (diff) | |
compiles example and it runs
Diffstat (limited to 'protoParse.go')
| -rw-r--r-- | protoParse.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/protoParse.go b/protoParse.go index bd7db81..9aef560 100644 --- a/protoParse.go +++ b/protoParse.go @@ -27,14 +27,14 @@ func (pb *Files) hasPluralMessage(f *File) error { line := scanner.Text() base := cases.Title(language.English, cases.NoLower).String(f.Filebase) - prefix := "message " + base + "s" // to conform, it must have an added 's' + prefix := "message " + base + "s {" // to conform, it must have an added 's' if !strings.HasPrefix(line, prefix) { // log.Info("nope", prefix, "line", line) // nope, not this line continue } // found the matching message - // f.Bases = f.parseForMessage(line) + f.Bases = f.parseForMessage(line) line = scanner.Text() fields := strings.Fields(line) @@ -78,9 +78,9 @@ func (pb *Files) protoParse(f *File) error { base := cases.Title(language.English, cases.NoLower).String(f.Filebase) if strings.HasPrefix(line, "message ") { curmsg = f.parseForMessage(line) - prefix := "message " + base // only look for this for now + prefix := "message " + base + " {" // only look for this for now if strings.HasPrefix(line, prefix) { - // f.Base = curmsg + f.Base = curmsg } else { f.MsgNames = append(f.MsgNames, curmsg) } @@ -118,7 +118,7 @@ func (f *File) parseForMessage(line string) *MsgName { if fields[0] != "message" { return nil } - msgName := fields[1] + msgName := cases.Title(language.English, cases.NoLower).String(fields[1]) log.Info("found messge:", msgName) msg := new(MsgName) msg.Name = msgName |
