Mercurial > emacs
comparison lisp/json.el @ 92086:23ee465a6963
(top-level): No need to require thingatpt.
(json-read-keyword): Use thing-at-point rather than word-at-point.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Fri, 22 Feb 2008 03:56:25 +0000 |
parents | 2b55e8843eff |
children | e670b615aad9 |
comparison
equal
deleted
inserted
replaced
92085:ba71847b7f2e | 92086:23ee465a6963 |
---|---|
51 ;; 2008-02-21 - Installed in GNU Emacs. | 51 ;; 2008-02-21 - Installed in GNU Emacs. |
52 | 52 |
53 ;;; Code: | 53 ;;; Code: |
54 | 54 |
55 (eval-when-compile (require 'cl)) | 55 (eval-when-compile (require 'cl)) |
56 (require 'thingatpt) | |
57 | 56 |
58 ;; Compatibility code | 57 ;; Compatibility code |
59 | 58 |
60 (defalias 'json-encode-char0 'encode-char) | 59 (defalias 'json-encode-char0 'encode-char) |
61 (defalias 'json-decode-char0 'decode-char) | 60 (defalias 'json-decode-char0 'decode-char) |
198 (mapc (lambda (char) | 197 (mapc (lambda (char) |
199 (unless (char-equal char (json-peek)) | 198 (unless (char-equal char (json-peek)) |
200 (signal 'json-unknown-keyword | 199 (signal 'json-unknown-keyword |
201 (list (save-excursion | 200 (list (save-excursion |
202 (backward-word 1) | 201 (backward-word 1) |
203 (word-at-point))))) | 202 (thing-at-point 'word))))) |
204 (json-advance)) | 203 (json-advance)) |
205 keyword) | 204 keyword) |
206 (unless (looking-at "\\(\\s-\\|[],}]\\|$\\)") | 205 (unless (looking-at "\\(\\s-\\|[],}]\\|$\\)") |
207 (signal 'json-unknown-keyword | 206 (signal 'json-unknown-keyword |
208 (list (save-excursion | 207 (list (save-excursion |
209 (backward-word 1) | 208 (backward-word 1) |
210 (word-at-point))))) | 209 (thing-at-point 'word))))) |
211 (cond ((string-equal keyword "true") t) | 210 (cond ((string-equal keyword "true") t) |
212 ((string-equal keyword "false") json-false) | 211 ((string-equal keyword "false") json-false) |
213 ((string-equal keyword "null") json-null))) | 212 ((string-equal keyword "null") json-null))) |
214 | 213 |
215 ;; Keyword encoding | 214 ;; Keyword encoding |