1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-23 07:19:15 +00:00

(json-advance): Use forward-char.

(json-skip-whitespace): Use skip-syntax-forward.
This commit is contained in:
Chong Yidong 2008-10-07 16:18:22 +00:00
parent e9701d1680
commit ac611f4ffa

View File

@ -123,11 +123,7 @@ this around your call to `json-read' instead of `setq'ing it.")
(defsubst json-advance (&optional n)
"Skip past the following N characters."
(unless n (setq n 1))
(let ((goal (+ (point) n)))
(goto-char goal)
(when (< (point) goal)
(signal 'end-of-file nil))))
(forward-char n))
(defsubst json-peek ()
"Return the character at point."
@ -144,8 +140,7 @@ this around your call to `json-read' instead of `setq'ing it.")
(defun json-skip-whitespace ()
"Skip past the whitespace at point."
(while (looking-at "[\t\r\n\f\b ]")
(goto-char (match-end 0))))
(skip-syntax-forward " "))