mirror of https://github.com/lark-parser/lark.git
Tiny fix in reconstruct_json (Py3)
This commit is contained in:
parent
c9b45823ed
commit
abfa14c721
|
@ -27,14 +27,14 @@ def test():
|
||||||
json_parser = Lark(json_grammar)
|
json_parser = Lark(json_grammar)
|
||||||
tree = json_parser.parse(test_json)
|
tree = json_parser.parse(test_json)
|
||||||
|
|
||||||
# print '@@', tree.pretty()
|
# print ('@@', tree.pretty())
|
||||||
# for x in tree.find_data('true'):
|
# for x in tree.find_data('true'):
|
||||||
# x.data = 'false'
|
# x.data = 'false'
|
||||||
# # x.children[0].value = '"HAHA"'
|
# # x.children[0].value = '"HAHA"'
|
||||||
|
|
||||||
|
|
||||||
new_json = Reconstructor(json_parser).reconstruct(tree)
|
new_json = Reconstructor(json_parser).reconstruct(tree)
|
||||||
print new_json
|
print (new_json)
|
||||||
print json.loads(new_json) == json.loads(test_json)
|
print (json.loads(new_json) == json.loads(test_json))
|
||||||
|
|
||||||
test()
|
test()
|
||||||
|
|
Loading…
Reference in New Issue