allow interacting with key value pairs via subscription
example usage:
import json5.loader
import json5.dumper
model = json5.loader.loads('{foo: "bar" /*a comment */, "a": 1}', loader=json5.loader.ModelLoader())
model.value["foo"] = json5.dumper.modelize("not-bar")
print(json5.dumper.dumps(model, dumper=json5.dumper.ModelDumper()))
I think all I need is some tests for this and we should be good to merge.
So, revisiting this, I'm having some doubts about this on account of the fact that duplicate keys are allowed, at least in the abstract model. The same thing is true in Python ast.Dict nodes.
Perhaps we can still allow this, but I think the right behavior of this would have to search the key value pairs in reverse order because of the issue of duplicate keys -- that is: the item returned should be the node object for the corresponding value as if the JSONObject were eventually dumped (where the last key overrides any previous keys of the same value).