RakuyoKit / JSONPreview

🎨 A view that previews JSON in highlighted form, it also provides the ability to format and collapse nodes.
MIT License
65 stars 13 forks source link

Compatible with the wrong JSON. #7

Closed rakuyoMo closed 2 years ago

rakuyoMo commented 2 years ago

In version 2.0.0, I borrowed the JSON parsing algorithm from Apple Swift. This has improved the parsing speed of JSONPreview exponentially.

But there is currently a problem: Apple's algorithm is designed to parse correct JSON and report errors for incorrect JSON. This is not consistent with the current JSONPreview processing logic.

I've tried to modify on Apple's algorithm, but I've been out of ideas.

Hopefully I can get help or be told that this functionality is not important and can be removed from JSONPreview.

rakuyoMo commented 2 years ago

I finally implemented the feature. It doesn't quite match the results of version 1.0.0, but it still handles some common errors.

And from the results, it seems that version 2.0.0 supports detecting more errors compared to the error checking in version 1.0.0.