data.json

Add positional tracking to JSON reader

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Patch:
    Code and Test

Description

The attached patches add an optional argument to clojure.data.json/read, :track-pos?, that causes the line and column number information for each array and object member to be stored as metadata on the result. Line and column numbers are also added to the various exception messages. Useful for doing validation on a JSON file so that the user can mor easily determine where a problem exists.

Activity

Hide
Tim Clemons added a comment -

FYI, it appears my Contributor Agreement has been received and processed: http://clojure.org/contributing

Show
Tim Clemons added a comment - FYI, it appears my Contributor Agreement has been received and processed: http://clojure.org/contributing
Hide
Stuart Sierra added a comment -

I'm not opposed to this feature in principle, but I do not want to take the performance hit of this patch: more than 5X slower in my tests, regardless of whether or not you use the feature.

Show
Stuart Sierra added a comment - I'm not opposed to this feature in principle, but I do not want to take the performance hit of this patch: more than 5X slower in my tests, regardless of whether or not you use the feature.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: