mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-17 00:22:26 +08:00
协议代理枚举类型修复
This commit is contained in:
@@ -57,7 +57,7 @@ func TestClientProtoGen(t *testing.T) {
|
|||||||
if !strings.Contains(line, "enum") {
|
if !strings.Contains(line, "enum") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
split := strings.Split(line, " ")
|
split := strings.Split(strings.TrimSpace(line), " ")
|
||||||
if len(split) != 3 || split[0] != "enum" || split[2] != "{" {
|
if len(split) != 3 || split[0] != "enum" || split[2] != "{" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -66,16 +66,16 @@ func TestClientProtoGen(t *testing.T) {
|
|||||||
if refEnum == nil {
|
if refEnum == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
for _, ref := range refEnum {
|
||||||
|
newFileStr += ref + "\n"
|
||||||
|
}
|
||||||
i++
|
i++
|
||||||
x := 0
|
|
||||||
for {
|
for {
|
||||||
nextLine := rawFileLine[i]
|
nextLine := rawFileLine[i]
|
||||||
if !strings.Contains(nextLine, "}") && x < len(refEnum) {
|
if !strings.Contains(nextLine, "}") {
|
||||||
newFileStr += refEnum[x] + "\n"
|
|
||||||
i++
|
i++
|
||||||
x++
|
|
||||||
} else {
|
} else {
|
||||||
newFileStr += line + "\n"
|
newFileStr += nextLine + "\n"
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -111,7 +111,7 @@ func FindEnumInDirFile(path string, name string) (lineList []string) {
|
|||||||
if !strings.Contains(line, "enum") {
|
if !strings.Contains(line, "enum") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
split := strings.Split(line, " ")
|
split := strings.Split(strings.TrimSpace(line), " ")
|
||||||
if len(split) != 3 || split[0] != "enum" || split[2] != "{" {
|
if len(split) != 3 || split[0] != "enum" || split[2] != "{" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user