On 7/29/2015 1:37 AM, Sönke Ludwig wrote:
There are actually even four levels: 1. Range of characters 2. Range of tokens 3. Range of nodes 4. DOM value
What's the need for users to see a token stream? I don't know what the DOM value is - is that just JSON as an ast?
Having a special case for range of DOM values may or may not be a worthwhile thing to optimize for handling big JSON arrays of values.
I see no point for that.
Currently not all, but most, conversions between the levels are implemented, and sometimes a level is skipped for efficiency. The question is if it would be worth the effort and the API complexity to implement all of them. lexJSON: character range -> token range parseJSONStream: character range -> node range parseJSONStream: token range -> node range parseJSONValue: character range -> DOM value parseJSONValue: token range -> DOM value (same for toJSONValue) writeJSON: token range -> character range (output range) writeJSON: node range -> character range (output range) writeJSON: DOM value -> character range (output range) writeJSON: to -> character range (output range) (same for toJSON with string output)
I don't see why there are more than the 3 I mentioned.
