;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\207" [require typescript-mode ng2-shared] 2) (defconst ng2-ts-name-re "\\_<[A-Za-z_$]\\(?:\\s_\\|\\sw\\)*\\_>") (defconst ng2-ts-type-name-re "\\_<[A-Z_$]\\(?:\\s_\\|\\sw\\)*\\_>") (defconst ng2-ts-decorator-re (concat "\\(@" ng2-ts-name-re "\\)")) (defconst ng2-ts-keyword-re (ng2--re-opt "is" "infer")) (defconst ng2-ts-type-keyword-re (ng2--re-opt "void" "string" "number" "boolean" "object" "any" "unknown" "never")) (defconst ng2-ts-interp-re "\\(${\\).*?\\(}\\)") (defconst ng2-ts-type-annotated-re (concat "\\(" ng2-ts-name-re "\\)\\s-*[?!]?\\s-*:")) (defconst ng2-ts-type-re (concat "\\(?:\\(?:" ng2-ts-type-keyword-re "\\)\\|\\(?:\\(?:" ng2-ts-type-name-re "\\|" ng2-ts-name-re "\\.\\)*\\(" ng2-ts-type-name-re "\\)\\(?:\\[\\(" ng2-ts-type-name-re "\\)\\]\\)?\\)\\)")) (defconst ng2-ts-type-annotation-re (concat ":\\s-*" ng2-ts-type-re "\\s-*")) (defconst ng2-ts-var-like-search-re "\\(?:public\\|protected\\|private\\|readonly\\)\\s-+\\(%s\\)\\s-*[?!]?\\s-*\\(?:[=:].*\\|;?\\)$") (defconst ng2-ts-var-like-re (format ng2-ts-var-like-search-re ng2-ts-name-re)) (defconst ng2-ts-type-arithmetic-re (concat "[()]?\\s-*[|&]\\s-*[()]?\\s-*" ng2-ts-type-re "\\s-*")) (defconst ng2-ts-typedef-re (concat "type\\s-\\(" ng2-ts-type-name-re "\\)\\s-*=\\s-*\\(" ng2-ts-type-re "\\)")) (defconst ng2-ts-postfix-type-like-re (byte-code "\301\302\303\304\305\"\306\260\207" [ng2-ts-type-re "\\(" "\\)\\s-+\\(?:" ng2--re-opt "implements" "extends" "\\|\\(?:in\\|extends\\)\\s-+keyof\\)"] 6)) (defconst ng2-ts-prefix-type-like-re (byte-code "\301\302\303\304\305\306\307\310\311\312& \313\314R\207" [ng2-ts-type-re ng2--re-opt "is" "as" "keyof" "instanceof" "infer" "extends" "implements" "class" "interface" "\\s-+\\(" "\\)"] 10)) (defconst ng2-ts-import-default-type-re (concat "\\_")) (defconst ng2-ts-type-condition-re (concat "extends\\s-+.+?\\s-*\\?\\s-*" ng2-ts-type-re "\\s-*:")) (defconst ng2-ts-lambda-re "=>") (defconst ng2-ts-generic-re (concat "<" ng2-ts-type-re ".*?>")) (defconst ng2-ts-inner-generic-re (concat "<" ng2-ts-type-re ">")) (defconst ng2-ts-method-re (concat "\\.\\(" ng2-ts-name-re "\\)(")) (defconst ng2-ts-fn-search-re (concat "\\(%s\\)\\(?:<.*?>\\)?([^)]*)\\s-*\\(?::\\s-*" ng2-ts-type-re "\\)?\\(?:<.*?>\\)?\\s-*{")) (defconst ng2-ts-fn-re (format ng2-ts-fn-search-re ng2-ts-name-re)) #@50 Whether POS is inside a Typescript import block. (defalias 'ng2-ts--inside-import-block-p #[(pos) "\303 \304\216\212 b\210\305\306\307\310#\210\311\312!\210\313\310\314!)\262)\205<\212 b\210\315\316\307\310#\210\311\317!\210\311\312!\210\320\310\314!)\262)*\207" [save-match-data-internal pos inhibit-changing-match-data match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] search-backward "{" nil t forward-symbol -1 "import" looking-at search-forward "}" 1 "from"] 4 (#$ . 2516)]) #@71 Return the position at the next end of an import statement after POS. (defalias 'ng2-ts--end-of-import #[(pos) "\302 \303\216\212 b\210\304\305\306\307#\210\306\210`+\207" [save-match-data-internal pos match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] re-search-forward "}?\\s-*from" nil t] 4 (#$ . 3050)]) #@62 Match a type inside an import block between point and BOUND. (defalias 'ng2-ts--highlight-import-block-fn #[(bound) "\303`!\203\304 \305`!^\306#\206#\307 \310\216\311\312 \306#*\205#\313 !\207" [ng2-ts-type-name-re bound save-match-data-internal ng2-ts--inside-import-block-p re-search-forward ng2-ts--end-of-import 1 match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] search-forward "{" ng2-ts--highlight-import-block-fn] 5 (#$ . 3405)]) #@66 Return whether POS is inside the arguments to an arrow function. (defalias 'ng2-ts--inside-lambda-args-p #[(pos) "\302 \303\216\304\212 b\210\305\306\307\310#\210\311 \210`) \212 b\210\305\306\307\310#\210\311 \210\312 \210`S)#*\207" [save-match-data-internal pos match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] <= search-forward "=>" nil t backward-sexp forward-sexp] 7 (#$ . 3895)]) #@66 Return the first end of an arrow function's arguments after POS. (defalias 'ng2-ts--end-of-lambda-args #[(pos) "\302 \303\216\212 b\210\304\305\306\307#\210`+\207" [save-match-data-internal pos match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] search-forward "=>" nil t] 4 (#$ . 4329)]) #@56 Move POINT past all contiguous whitespace ahead of it. (defalias 'ng2-ts--skip-whitespace #[nil "\301 \302\216\303\304!\205\305u\210\202*\207" [save-match-data-internal match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] looking-at "\\s-" nil] 2 (#$ . 4663)]) #@62 Match a type inside an import block between point and BOUND. (defalias 'ng2-ts--highlight-lambda-args-fn #[(bound) "\303`!\203\304\305\306\307\260 \310`!^\311#\206=\31214\313 \210\314u\210\315 \316\216\317\320 \311#*\321 \2100\2027\210\322\207\205=\323 !\207" [ng2-ts-name-re bound save-match-data-internal ng2-ts--inside-lambda-args-p re-search-forward "\\(" "\\)\\(?:\\s-*:\\s-*\\(" "\\)\\)?\\(?:\\s-*=\\s-*.*?\\(?:[,})]\\|\\]\\)\\)?" ng2-ts--end-of-lambda-args 1 (error) ng2-ts--skip-whitespace 2 match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] search-forward "=>" backward-sexp nil ng2-ts--highlight-lambda-args-fn] 6 (#$ . 4972)]) #@59 Places the point on the variable or function called NAME. (defalias 'ng2-ts-goto-name #[(name) "eb\210\303\304 \"\305\306#?\205\303\304\n \"\305\306#?\205\307\310 \"\207" [ng2-ts-fn-search-re name ng2-ts-var-like-search-re search-forward-regexp format nil t message "ng2-ts-mode: Couldn't find %s"] 4 (#$ . 5666)]) #@25 Keymap for ng2-ts-mode. (defvar ng2-ts-mode-map (byte-code "\301 \302\303\304#\210)\207" [map make-keymap define-key "" ng2-open-counterpart] 4) (#$ . 5992)) (defvar ng2-ts-font-lock-keywords (byte-code "\306B\307B \310B \311B\n\312B \313B \314B \315B\f\316B\f\317B \320B \321B!\322B!\323B\"\324B#\325B$\326B%\327B&\330B&\331B'\332B'\333B(\334B)\335B*\336B+\337B\340BBBBBBBBBBBBBBBBBBBBBBBBBB\207" [ng2-ts-type-condition-re ng2-ts-interp-re ng2-ts-type-annotated-re ng2-ts-type-annotation-re ng2-ts-type-arithmetic-re ng2-ts-prefix-type-like-re ((1 font-lock-type-face nil t)) ((2 font-lock-type-face nil t)) (1 font-lock-variable-name-face t) (2 font-lock-variable-name-face t) ((1 font-lock-variable-name-face)) ((1 font-lock-type-face nil t)) ((2 font-lock-type-face nil t)) ((2 font-lock-type-face nil t)) ((1 font-lock-type-face nil t)) ((2 font-lock-type-face nil t)) ((1 font-lock-type-face nil t)) ((2 font-lock-type-face nil t)) ((1 font-lock-type-face nil t)) ((2 font-lock-type-face nil t)) ((1 font-lock-type-face)) ((1 font-lock-variable-name-face)) ((1 font-lock-function-name-face)) ((1 font-lock-function-name-face)) ((1 font-lock-type-face nil t)) ((2 font-lock-type-face nil t)) ((1 font-lock-type-face nil t)) ((2 font-lock-type-face nil t)) ((0 font-lock-function-name-face)) ((0 font-lock-builtin-face)) ((0 font-lock-type-face)) ((0 font-lock-keyword-face)) ((ng2-ts--highlight-import-block-fn (0 font-lock-type-face)) (ng2-ts--highlight-lambda-args-fn (1 font-lock-variable-name-face)) (ng2-ts--highlight-lambda-args-fn (2 font-lock-variable-name-face nil t))) ng2-ts-postfix-type-like-re ng2-ts-import-default-type-re ng2-ts-var-like-re ng2-ts-method-re ng2-ts-fn-re ng2-ts-generic-re ng2-ts-inner-generic-re ng2-ts-lambda-re ng2-ts-decorator-re ng2-ts-type-keyword-re ng2-ts-keyword-re] 27)) (defvar ng2-ts-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [ng2-ts-mode-hook variable-documentation put "Hook run after entering ng2-ts mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp ng2-ts-mode-map definition-name ng2-ts-mode] 4) (defvar ng2-ts-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" [ng2-ts-mode-abbrev-table ng2-ts-mode-map variable-documentation put purecopy "Keymap for `ng2-ts-mode'." boundp ng2-ts-mode-syntax-table definition-name ng2-ts-mode (lambda (def-tmp-var) (defvar ng2-ts-mode-syntax-table def-tmp-var)) make-syntax-table "Syntax table for `ng2-ts-mode'." (lambda (def-tmp-var) (defvar ng2-ts-mode-abbrev-table def-tmp-var)) define-abbrev-table nil "Abbrev table for `ng2-ts-mode'." derived-mode-parent typescript-mode] 5) #@233 Major mode for Angular 2 TypeScript In addition to any hooks its parent mode `typescript-mode' might have run, this mode runs the hook `ng2-ts-mode-hook', as the final or penultimate step during initialization. \{ng2-ts-mode-map} (defalias 'ng2-ts-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 \325!C#\210\327 !\210\330\f!\210 !\331\332\333\f#\210\334\335\"\"\210)\336\337!\207" [delay-mode-hooks major-mode mode-name ng2-ts-mode-map ng2-ts-mode-syntax-table parent make-local-variable t typescript-mode ng2-ts-mode "ng2-ts" 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 modify-syntax-entry 36 "_" font-lock-add-keywords nil run-mode-hooks ng2-ts-mode-hook ng2-ts-mode-abbrev-table local-abbrev-table ng2-ts-font-lock-keywords] 6 (#$ . 9000) nil]) (byte-code "\300\301\302\"\210\300\301\303\"\210\300\301\304\"\210\300\301\305\"\210\300\301\306\"\210\300\301\307\"\210\310\311!\207" [add-to-list auto-mode-alist ("\\.component.ts\\'" . ng2-ts-mode) ("\\.service.ts\\'" . ng2-ts-mode) ("\\.pipe.ts\\'" . ng2-ts-mode) ("\\.directive.ts\\'" . ng2-ts-mode) ("\\.guard.ts\\'" . ng2-ts-mode) ("\\.module.ts\\'" . ng2-ts-mode) provide ng2-ts] 3)