[DJSON-16] Add positional tracking to JSON reader Created: 18/May/14 Updated: 06/Jun/14 Resolved: 06/Jun/14
|Reporter:||Tim Clemons||Assignee:||Stuart Sierra|
|Labels:||enhancement, errormsgs, patch|
|Attachments:||0001-Explicity-define-whitespace-characters.patch 0002-Add-position-tracking-to-reader.patch 0003-Add-line-and-column-information-to-read-exceptions.patch 0004-Add-stack-of-structure-starting-points-to-reader.patch 0005-Add-track-pos-argument-to-read.patch 0006-Replace-instances-of-printf-with-format.patch|
|Patch:||Code and Test|
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.
|Comment by Tim Clemons [ 27/May/14 4:37 PM ]|
FYI, it appears my Contributor Agreement has been received and processed: http://clojure.org/contributing
|Comment by Stuart Sierra [ 06/Jun/14 3:24 PM ]|
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.