Kaynağa Gözat

Tiny fix in reconstruct_json (Py3)

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.5.1
Erez Shinan 7 yıl önce
ebeveyn
işleme
abfa14c721
1 değiştirilmiş dosya ile 3 ekleme ve 3 silme
  1. +3
    -3
      examples/reconstruct_json.py

+ 3
- 3
examples/reconstruct_json.py Dosyayı Görüntüle

@@ -27,14 +27,14 @@ def test():
json_parser = Lark(json_grammar)
tree = json_parser.parse(test_json)

# print '@@', tree.pretty()
# print ('@@', tree.pretty())
# for x in tree.find_data('true'):
# x.data = 'false'
# # x.children[0].value = '"HAHA"'


new_json = Reconstructor(json_parser).reconstruct(tree)
print new_json
print json.loads(new_json) == json.loads(test_json)
print (new_json)
print (json.loads(new_json) == json.loads(test_json))

test()

Yükleniyor…
İptal
Kaydet