emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 6aa04a5: * lisp/json.el (json-end-of-file): New err


From: Stefan Monnier
Subject: [Emacs-diffs] master 6aa04a5: * lisp/json.el (json-end-of-file): New error.
Date: Thu, 05 Feb 2015 19:52:09 +0000

branch: master
commit 6aa04a5570b50a68665e69231f3e36b2a4625f40
Author: Era Eriksson <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * lisp/json.el (json-end-of-file): New error.
    
    Fixes: debbugs:19768
    
    (json-pop, json-read): Use it.
---
 lisp/ChangeLog |    7 ++++++-
 lisp/json.el   |    6 ++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a1e43e14..9838d68 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2015-02-05  Era Eriksson  <address@hidden>
+
+       * json.el (json-end-of-file): New error (bug#19768).
+       (json-pop, json-read): Use it.
+
 2015-02-05  Kelly Dean <address@hidden>
 
        * help-mode.el (help-xref-interned): Pass BUFFER and FRAME to
@@ -14384,7 +14389,7 @@
        Change default to "# encoding: %s" to differentiate it from the
        default Ruby encoding comment template.
 
-2013-11-20  era eriksson  <address@hidden>
+2013-11-20  Era Eriksson  <address@hidden>
 
        * ses.el (ses-mode): Doc fix.  (Bug#14748)
 
diff --git a/lisp/json.el b/lisp/json.el
index 68ab020..98974e6 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
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]