From 718344dcc16cd51f7c336b96b34a9ea21ca2c7ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Thu, 30 Mar 2023 14:13:09 +0800 Subject: [PATCH] =?UTF-8?q?value=E8=A7=A3=E6=9E=90=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=BD=AC=E4=B9=89=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tree/generate.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tree/generate.go b/tree/generate.go index 5af3eb7..322b27f 100644 --- a/tree/generate.go +++ b/tree/generate.go @@ -268,6 +268,15 @@ func (g *Generate) getValue(startIndex int) (string, int, error) { } } isStart = true + if str == KeywordEscapeSymbol { + // 转义符 + startIndex++ + if startIndex >= len(g.jsonDataByte) { + // 转义符后面没东西了 + return "", startIndex, errors.New("escape symbol without any data") + } + str = string(g.jsonDataByte[startIndex]) + } valArr = append(valArr, str) startIndex++ }