diff options
author | Era Eriksson <era+emacs@iki.fi> | 2015-02-05 14:52:03 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2015-02-05 14:52:03 -0500 |
commit | 6aa04a5570b50a68665e69231f3e36b2a4625f40 (patch) | |
tree | 71c5c3f494ce7f86fc1652174cb5b7074afef290 /lisp/json.el | |
parent | f06902840eff62e83858a40b4e139b61d254107a (diff) | |
download | emacs-6aa04a5570b50a68665e69231f3e36b2a4625f40.tar.gz |
* lisp/json.el (json-end-of-file): New error.
Fixes: debbugs:19768
(json-pop, json-read): Use it.
Diffstat (limited to 'lisp/json.el')
-rw-r--r-- | lisp/json.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/json.el b/lisp/json.el index 68ab020c379..98974e67b7e 100644 --- a/lisp/json.el +++ b/lisp/json.el @@ -166,7 +166,7 @@ without indentation.") "Advance past the character at point, returning it." (let ((char (json-peek))) (if (eq char :json-eof) - (signal 'end-of-file nil) + (signal 'json-end-of-file nil) (json-advance) char))) @@ -186,6 +186,8 @@ without indentation.") (define-error 'json-string-format "Bad string format" 'json-error) (define-error 'json-key-format "Bad JSON object key" 'json-error) (define-error 'json-object-format "Bad JSON object" 'json-error) +(define-error 'json-end-of-file "End of file while parsing JSON" + '(end-of-file json-error)) @@ -554,7 +556,7 @@ Advances point just past JSON object." (if (functionp (car record)) (apply (car record) (cdr record)) (signal 'json-readtable-error record))) - (signal 'end-of-file nil)))) + (signal 'json-end-of-file nil)))) ;; Syntactic sugar for the reader |