summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/syntax.el
diff options
context:
space:
mode:
authorSimen Heggestøyl <simenheg@gmail.com>2015-11-08 21:44:21 +0100
committerSimen Heggestøyl <simenheg@gmail.com>2015-11-08 21:44:21 +0100
commit29d740aac9773334d8189a1cc989634a48a70061 (patch)
treeba5f1cbec0b0b413570cdfed8fd9fd5e19bda6e6 /lisp/emacs-lisp/syntax.el
parent5193ad1bcbb4ec80f25cfbfae8e168360fc00534 (diff)
downloademacs-29d740aac9773334d8189a1cc989634a48a70061.tar.gz
emacs-29d740aac9773334d8189a1cc989634a48a70061.tar.bz2
emacs-29d740aac9773334d8189a1cc989634a48a70061.zip
Add support for retrieving paths to JSON elements
Add support for retrieving the path to a JSON element. This can for instance be useful to retrieve paths in deeply nested JSON structures. * lisp/json.el (json-pre-element-read-function) (json-post-element-read-function): New variables to hold pre- and post read callback functions for `json-read-array' and `json-read-object'. (json--path): New variable used internally by `json-path-to-position'. (json--record-path, json--check-position): New functions used internally by `json-path-to-position'. (json-path-to-position): New function for retrieving the path to a JSON element at a given position. (json-read-object, json-read-array): Call `json-pre-element-read-function' and `json-post-element-read-function' when set. * test/automated/json-tests.el (test-json-path-to-position-with-objects) (test-json-path-to-position-with-arrays) (test-json-path-to-position-no-match): New tests for `json-path-to-position'.
Diffstat (limited to 'lisp/emacs-lisp/syntax.el')
0 files changed, 0 insertions, 0 deletions