diff --git a/lexical.go b/lexical.go index 526d0e0..978c6b9 100644 --- a/lexical.go +++ b/lexical.go @@ -80,6 +80,13 @@ func (l *lexical) Parse(jsonData string) ([]*lexicalNode, error) { tmpStr = tmpStr + currentChar } } + if len(tmpStr) > 0 { + l.lexicalResult = append(l.lexicalResult, &lexicalNode{ + Val: tmpStr, + IsToken: false, + }) + tmpStr = "" + } // 格式化, 去掉 \n \t 等换行符 format := make([]*lexicalNode, 0) for idx, val := range l.lexicalResult {