词法分析树增加String()方法

This commit is contained in:
2022-07-05 14:42:43 +08:00
parent 6a3548766d
commit 81085d9477
3 changed files with 33 additions and 10 deletions

View File

@ -34,9 +34,7 @@ func Test_parseLexical(t *testing.T) {
}`
//jsonData = `{"name":"zhangsan","age":"18","extension":{"sex":"man","height":"180"},"teacher_list":[{"name":"t1","age":"11"},{"name":"t2","age":"12"}]}`
r, _ := NewLexical(jsonData).Parse(jsonData)
for _, val := range r {
fmt.Print(val.Val)
}
fmt.Print("\n")
instance := NewLexical(jsonData)
_ = instance.Parse()
fmt.Println(instance.String())
}