From ec4afa3b16e5b7119916a5c3260b3fa2bd940f66 Mon Sep 17 00:00:00 2001 From: yuanzhao <2206582181@qq.com> Date: Tue, 14 Mar 2023 11:41:00 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E8=B6=85=E8=BF=87=E4=B8=A4=E6=AC=A1?= =?UTF-8?q?=E5=9B=9E=E8=BD=A6=E5=A4=8D=E5=8E=9F0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parser/protoc.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/parser/protoc.go b/parser/protoc.go index f2d149c..b303454 100644 --- a/parser/protoc.go +++ b/parser/protoc.go @@ -223,13 +223,20 @@ func protoService(l []*word, offset int) (Service, int) { Rpc: make(map[string]ServiceRpc, 0), } doc := "" + countDoc := 0 // 超过两次回车复原0 for offset := 0; offset < len(nl); offset++ { work := nl[offset] switch work.Ty { case wordT_line: + countDoc = countDoc + 1 + if countDoc == 2 { + countDoc = 0 + doc = "" + } case wordT_division: case wordT_doc: doc += work.Str + countDoc = 0 case wordT_word: switch work.Str { case "option":