Files
emacsd/elpa/json-mode-20190123.422/json-mode.elc

66 lines
8.1 KiB
Plaintext
Raw Normal View History

2019-10-27 19:05:34 +01:00
;ELC
;;; Compiled
;;; in Emacs version 26.3
;;; with all optimizations.
;;; This file contains utf-8 non-ASCII characters,
;;; and so cannot be loaded into Emacs 22 or earlier.
(and (boundp 'emacs-version)
(< (aref emacs-version (1- (length emacs-version))) ?A)
(string-lessp emacs-version "23")
(error "`%s' was compiled for Emacs 23 or later" #$))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\305\306\307\310\311\301%\207" [require js rx json-snatcher json-reformat custom-declare-group json-mode nil "Major mode for editing JSON files." :group] 6)
#@31 List of JSON file extensions.
(defconst json-mode-standard-file-ext '(".json" ".jsonld") (#$ . 629))
#@138 Update the `json-mode' entry of `auto-mode-alist'.
FILENAMES should be a list of file as string.
Return the new `auto-mode-alist' entry
(defalias 'json-mode--update-auto-mode #[(filenames) "\306\307\310\311\312\313\314\315DEED\316BB!\211\317B\320\303!\205 \321\f \"\322\305\n\"\210\n+\207" [filenames new-regexp new-entry json-mode--auto-mode-entry old-entry auto-mode-alist rx-to-string seq eval cons 'or append json-mode-standard-file-ext quote (eot) json-mode boundp delete add-to-list] 10 (#$ . 737)])
(byte-code "\300\301\302\303#\210\304\305\306\307\310\311\312\313\314\315& \207" [put json-mode--update-auto-mode byte-optimizer byte-compile-inline-expand custom-declare-variable json-mode-auto-mode-list '(".babelrc" ".bowerrc" "composer.lock") "List of filename as string to pass for the JSON entry of\n`auto-mode-alist'.\n\nNote however that custom `json-mode' entries in `auto-mode-alist'\nwont be affected." :group json-mode :type (repeat string) :set #[(symbol value) "\306 \"\210 \307\310\311\312\313\314\315\316\nDEED\317BB!\211\320B\321\305!\205$ \322\"\323\324\f\"\210\f,\211\207" [symbol value filenames new-regexp new-entry json-mode--auto-mode-entry set-default rx-to-string seq eval cons 'or append json-mode-standard-file-ext quote (eot) json-mode boundp delete add-to-list auto-mode-alist old-entry] 9 "Update SYMBOL with a new regexp made from VALUE.\n\nThis function calls `json-mode--update-auto-mode' to change the\n`json-mode--auto-mode-entry' entry in `auto-mode-alist'."]] 10)
#@55 Regexp generated from the `json-mode-auto-mode-list'.
(defvar json-mode--auto-mode-entry (byte-code "\306\307\310\311\312\313\314\315 DEED\316BB!\211\317B\320\304!\205\f\321 \"\322\323 \"\210 ,\207" [json-mode-auto-mode-list filenames new-regexp new-entry json-mode--auto-mode-entry old-entry rx-to-string seq eval cons 'or append json-mode-standard-file-ext quote (eot) json-mode boundp delete add-to-list auto-mode-alist] 9) (#$ . 2274))
(defconst json-mode-quoted-string-re "\\(\"\\(?:\\\\\\\\\\|\\\\\"\\|\\\\[^\"\\]\\|[^\"\\]\\)*\"\\)")
(defconst json-mode-quoted-key-re "\\(\"\\(?:\\\\\\\\\\|\\\\\"\\|\\\\[^\"\\]\\|[^\"\\]\\)*\"\\)[[:blank:]]*:")
(defconst json-mode-number-re "\\([[:digit:]]+\\(?:\\.[[:digit:]]+\\)?\\)")
(defconst json-mode-keyword-re "\\(\\(?:false\\|null\\|true\\)\\)")
#@22 Level one font lock.
(defconst json-font-lock-keywords-1 (byte-code "\306 E\n\306 E\f\306 E\306 EF\207" [json-mode-quoted-key-re font-lock-keyword-face json-mode-quoted-string-re font-lock-string-face json-mode-keyword-re font-lock-constant-face 1 json-mode-number-re] 6) (#$ . 3087))
(defvar json-mode-hook nil)
(byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [json-mode-hook variable-documentation put "Hook run after entering JSON mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp json-mode-map definition-name json-mode] 4)
(defvar json-mode-map (make-sparse-keymap))
(byte-code "\301\302N\204\303\301\302\304\305!#\210\306\307!\204\303\307\310\311#\210\312\313 !\210\307\302N\204-\303\307\302\304\314!#\210\306\300!\204B\303\300\310\311#\210\315\316\300\317\"\210!\210\300\302N\204P\303\300\302\304\320!#\210\303\311\321\322#\207" [json-mode-abbrev-table json-mode-map variable-documentation put purecopy "Keymap for `json-mode'." boundp json-mode-syntax-table definition-name json-mode (lambda (#1=#:def-tmp-var) (defvar json-mode-syntax-table #1#)) make-syntax-table "Syntax table for `json-mode'." (lambda (#1#) (defvar json-mode-abbrev-table #1#)) define-abbrev-table nil "Abbrev table for `json-mode'." derived-mode-parent javascript-mode] 5)
#@227 Major mode for editing JSON files
In addition to any hooks its parent mode `javascript-mode' might have run,
this mode runs the hook `json-mode-hook', as the final or penultimate step
during initialization.
\{json-mode-map}
(defalias 'json-mode #[nil "\306\300!\210\307\310 \210\311\312\310\313N\203\314\311\313\310\313N#\210\315 !\204'\316 \317 \"\210\320\f!\211\2036 \321 =\203<\322\f\323 \"\210)\324\325\"\204V=\204V\326\325C#\210\327 !\210\330\f!\210\306\331!\210\332)\333\334!\207" [delay-mode-hooks major-mode mode-name json-mode-map json-mode-syntax-table parent make-local-variable t javascript-mode json-mode "JSON" mode-class put keymap-parent set-keymap-parent current-local-map char-table-parent standard-syntax-table set-char-table-parent syntax-table abbrev-table-get :parents abbrev-table-put use-local-map set-syntax-table font-lock-defaults (json-font-lock-keywords-1 t) run-mode-hooks json-mode-hook json-mode-abbrev-table local-abbrev-table] 6 (#$ . 4496) nil])
(add-to-list 'magic-fallback-mode-alist '("^[{[]$" . json-mode))
#@83 Print the path to the node at point to the minibuffer, and yank to the kill ring.
(defalias 'json-mode-show-path #[nil "\300\301 !\207" [message jsons-print-path] 2 (#$ . 5577) nil])
(define-key json-mode-map "" 'json-mode-show-path)
(defalias 'json-mode-kill-path #[nil "\300\301 !\207" [kill-new jsons-print-path] 2 nil nil])
(define-key json-mode-map "P" 'json-mode-kill-path)
#@87 Beautify / pretty-print the active region (or the entire buffer if no active region).
(defalias 'json-mode-beautify #[nil "\303\304 \203\305\306 \307 \"\202\305\310\311!\310\312!\"*\207" [js-indent-level json-reformat:pretty-string\? json-reformat:indent-width t use-region-p json-reformat-region region-beginning region-end buffer-end -1 1] 4 (#$ . 5966) nil])
(define-key json-mode-map "" 'json-mode-beautify)
#@46 If point is on `true' or `false', toggle it.
(defalias 'json-toggle-boolean #[nil "\303\304 8?\205U\305\306!\211\205\307@A\"`\205T \310\235\205T@A|\210 \311\230\203C\312c\210\nAU\203>\nT\202?\nb\202T\311c\210\nAU\203R\nS\202S\nb+\207" [bounds string pt 8 syntax-ppss bounds-of-thing-at-point symbol buffer-substring-no-properties ("true" "false") "true" "false"] 4 (#$ . 6393) nil])
(define-key json-mode-map "" 'json-toggle-boolean)
#@40 Replace the sexp at point with `null'.
(defalias 'json-nullify-sexp #[nil "\304 \305\306 8\203\305\202\204\307 8\2037\310 8b\210\212\311 \210\312\305w\210\305f)\313=\203/ A@b\210\314 \210\315c\202\204\316\300!\211\203o\315\317\320!)\262\206\204\212\321\305x\210\320 !)\203c\322\323\224\323\225\"\210\315c\202\204\322@A\"\210\315c\202\204\323 @W\203\203 A@b\210\314 \210\315c\202\204\305*\207" [symbol syntax inhibit-changing-match-data json-mode-number-re syntax-ppss nil 4 3 8 forward-sexp "[:space:]" 58 kill-sexp "null" bounds-of-thing-at-point t looking-at "[0-9.]" kill-region 0] 3 (#$ . 6856) nil])
(define-key json-mode-map " " 'json-nullify-sexp)
#@56 Add DELTA to the number at point; DELTA defaults to 1.
(defalias 'json-increment-number-at-point #[(&optional delta) "\212\304\305x\210\306!)\205+ \206\307\310\311\312\224\312\225\"!\\`\312\224\312\225|\210\313 !c\210\nb*\207" [json-mode-number-re delta pt num "[0-9.]" nil looking-at 1 string-to-number buffer-substring-no-properties 0 number-to-string] 5 (#$ . 7539) nil])
(define-key json-mode-map " " 'json-increment-number-at-point)
#@32 Decrement the number at point.
(defalias 'json-decrement-number-at-point #[nil "\300\301!\207" [json-increment-number-at-point -1] 2 (#$ . 7990) nil])
(byte-code "\301\302\303#\210\304\305!\207" [json-mode-map define-key "" json-decrement-number-at-point provide json-mode] 4)