]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/json.el (json-end-of-file): New error.
authorEra Eriksson <era+emacs@iki.fi>
Thu, 5 Feb 2015 19:52:03 +0000 (14:52 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 5 Feb 2015 19:52:03 +0000 (14:52 -0500)
Fixes: debbugs:19768
(json-pop, json-read): Use it.

lisp/ChangeLog
lisp/json.el

index a1e43e14c7bf07faf8b3bbe4dd35e0c0b1db3b93..9838d68f7d32618c5dd6782c6d94fffb35169c22 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-05  Era Eriksson  <era+emacs@iki.fi>
+
+       * json.el (json-end-of-file): New error (bug#19768).
+       (json-pop, json-read): Use it.
+
 2015-02-05  Kelly Dean <kelly@prtime.org>
 
        * help-mode.el (help-xref-interned): Pass BUFFER and FRAME to
        Change default to "# encoding: %s" to differentiate it from the
        default Ruby encoding comment template.
 
-2013-11-20  era eriksson  <era+emacsbugs@iki.fi>
+2013-11-20  Era Eriksson  <era+emacsbugs@iki.fi>
 
        * ses.el (ses-mode): Doc fix.  (Bug#14748)
 
index 68ab020c37963634ca10da94e0d555d79d8576bf..98974e67b7e304088c4baf21804b1df8b73bbd21 100644 (file)
@@ -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))
 
 \f
 
@@ -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