aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-10-07 16:18:22 +0000
committerChong Yidong2008-10-07 16:18:22 +0000
commitac611f4ffaa0c8d8f62f0d77f425b0df2e652602 (patch)
tree7c2363c2a5919f1d3eb851174d2410b339f0efc1
parente9701d16807d111687caf17a05679155a98c83e7 (diff)
downloademacs-ac611f4ffaa0c8d8f62f0d77f425b0df2e652602.tar.gz
emacs-ac611f4ffaa0c8d8f62f0d77f425b0df2e652602.zip
(json-advance): Use forward-char.
(json-skip-whitespace): Use skip-syntax-forward.
-rw-r--r--lisp/json.el9
1 files changed, 2 insertions, 7 deletions
diff --git a/lisp/json.el b/lisp/json.el
index 38ec16f5db7..203ec596980 100644
--- a/lisp/json.el
+++ b/lisp/json.el
@@ -123,11 +123,7 @@ this around your call to `json-read' instead of `setq'ing it.")
123 123
124(defsubst json-advance (&optional n) 124(defsubst json-advance (&optional n)
125 "Skip past the following N characters." 125 "Skip past the following N characters."
126 (unless n (setq n 1)) 126 (forward-char n))
127 (let ((goal (+ (point) n)))
128 (goto-char goal)
129 (when (< (point) goal)
130 (signal 'end-of-file nil))))
131 127
132(defsubst json-peek () 128(defsubst json-peek ()
133 "Return the character at point." 129 "Return the character at point."
@@ -144,8 +140,7 @@ this around your call to `json-read' instead of `setq'ing it.")
144 140
145(defun json-skip-whitespace () 141(defun json-skip-whitespace ()
146 "Skip past the whitespace at point." 142 "Skip past the whitespace at point."
147 (while (looking-at "[\t\r\n\f\b ]") 143 (skip-syntax-forward " "))
148 (goto-char (match-end 0))))
149 144
150 145
151 146