修复词法解析后,在合并, json格式错误问题. TODO : 修复部分关键字识别成普通字符串问题

This commit is contained in:
白茶清欢 2022-07-04 23:30:50 +08:00
parent 5b099f34c3
commit 7e48e92648

View File

@ -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 {