;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\302\303!\204\304\305!\210\300\207" [require tsc-obsolete functionp module-load error "Dynamic module feature not available, please compile Emacs --with-modules option turned on"] 2) #@51 Required version of the dynamic module `tsc-dyn'. (defconst tsc--dyn-version "0.15.1" (#$ . 297)) (byte-code "\301\302!\210\303!\210\301\304!\207" [tsc--dyn-version require tsc-dyn-get tsc-dyn-get-ensure tsc-dyn] 2) #@56 Execute BODY with narrowing disabled. (fn &rest BODY) (defalias 'tsc--without-restriction '(macro . #[128 "\300\301BB\207" [save-restriction (widen)] 4 (#$ . 520)])) (byte-code "\300\301\302\303#\300\207" [function-put tsc--without-restriction lisp-indent-function 0] 4) #@87 Execute BODY wrapped in a `save-excursion', with narrowing disabled. (fn &rest BODY) (defalias 'tsc--save-context '(macro . #[128 "\300\301BD\207" [save-excursion tsc--without-restriction] 4 (#$ . 799)])) (byte-code "\300\301\302\303#\300\207" [function-put tsc--save-context lisp-indent-function 0] 4) #@185 Convert POSITION to a valid tree-sitter point. A "point" in this context is a (LINE-NUMBER . BYTE-COLUMN) pair. See `tsc-parse-chunks' for a more detailed explanation. (fn POSITION) (defalias 'tsc-point-from-position #[257 "\212\214~\210\300!*\207" [tsc--point-from-position] 3 (#$ . 1111)]) #@209 Convert POSITION to a valid tree-sitter point. Prefer `tsc-point-from-position', unless there's a real performance bottleneck. This function must be called within a `tsc--save-context' block. (fn POSITION) (defalias 'tsc--point-from-position #[257 "\211b\210\300!\301!\301\302 !ZB\207" [line-number-at-pos position-bytes line-beginning-position] 5 (#$ . 1413)]) #@181 Convert tree-sitter POINT to buffer position. A "point" in this context is a (LINE-NUMBER . BYTE-COLUMN) pair. See `tsc-parse-chunks' for a more detailed explanation. (fn POINT) (defalias 'tsc-point-to-position #[257 "\212\214~\210\211@A\300b\210Sy\210\301\302\303 !\\!\266\202*\207" [1 byte-to-position position-bytes line-beginning-position] 7 (#$ . 1788)]) #@288 Return a portion of the current buffer's text, starting from BYTEPOS. BYTEPOS is automatically clamped to the range valid for the current buffer. This function must be called with narrowing disabled, e.g. within a `tsc--without-restriction' block. (fn BYTEPOS LINE-NUMBER BYTE-COLUMN) (defalias 'tsc--buffer-input #[771 "d\300]\301\\\302!\206\302!\206\303\"\207" [1 1024 byte-to-position buffer-substring-no-properties] 11 (#$ . 2160)]) #@187 Return the current buffer's text from BEG-BYTE to END-BYTE. This function must be called with narrowing disabled, e.g. within a `tsc--without-restriction' block. (fn BEG-BYTE END-BYTE) (defalias 'tsc--buffer-substring-no-properties #[514 "\300\301!\301!\"\207" [buffer-substring-no-properties byte-to-position] 6 (#$ . 2618)]) #@246 Return NODE's text, assuming it's from the current buffer's syntax tree. Prefer `tsc-node-text', unless there's a real bottleneck. This function must be called with narrowing disabled, e.g. within a `tsc--without-restriction' block. (fn NODE) (defalias 'tsc--node-text #[257 "\300!\211\242\243\301\"\207" [tsc-node-position-range buffer-substring-no-properties] 9 (#$ . 2955)]) #@85 Return NODE's text, assuming it's from the current buffer's syntax tree. (fn NODE) (defalias 'tsc-node-text #[257 "\214~\210\300!)\207" [tsc--node-text] 3 (#$ . 3347)]) #@145 Return the smallest node within NODE that spans the range (BEG . END). This function must be called in NODE's source buffer. (fn NODE BEG END) (defalias 'tsc-get-descendant-for-position-range #[771 "\300\301!\301!#\207" [tsc-get-descendant-for-byte-range position-bytes] 8 (#$ . 3525)]) #@151 Return the smallest named node within NODE that spans the range (BEG . END). This function must be called in NODE's source buffer. (fn NODE BEG END) (defalias 'tsc-get-named-descendant-for-position-range #[771 "\300\301!\301!#\207" [tsc-get-named-descendant-for-byte-range position-bytes] 8 (#$ . 3823)]) #@88 Return NODE's child associated with FIELD, which should be a keyword. (fn NODE FIELD) (defalias 'tsc-get-child-by-field #[514 "\300!\204 \301\302\300D\"\210\303\304!\305\306O\"\207" [keywordp signal wrong-type-argument tsc--get-child-by-field-name symbol-name 1 nil] 7 (#$ . 4138)]) #@96 Return NODE's start position. This function must be called in NODE's source buffer. (fn NODE) (defalias 'tsc-node-start-position #[257 "\300\301!!\207" [byte-to-position tsc-node-start-byte] 4 (#$ . 4433)]) #@94 Return NODE's end position. This function must be called in NODE's source buffer. (fn NODE) (defalias 'tsc-node-end-position #[257 "\300\301!!\207" [byte-to-position tsc-node-end-byte] 4 (#$ . 4648)]) #@113 Return NODE's (START-POSITION . END-POSITION). This function must be called in NODE's source buffer. (fn NODE) (defalias 'tsc-node-position-range #[257 "\300!\211\211\301@!\240\266\211\211\301A!\241\266\207" [tsc-node-byte-range byte-to-position] 6 (#$ . 4858)]) #@162 Move CURSOR to the first child that extends beyond the given POSITION. Return the index of the child node if one was found, nil otherwise. (fn CURSOR POSITION) (defalias 'tsc-goto-first-child-for-position #[514 "\300\301!\"\207" [tsc-goto-first-child-for-byte position-bytes] 6 (#$ . 5134)]) #@93 Return the numeric id of FIELD in LANGUAGE. FIELD should be a keyword. (fn LANGUAGE FIELD) (defalias 'tsc-lang-field-id #[514 "\300!\204 \301\302\300D\"\210\303\304!\305\306O\"\207" [keywordp signal wrong-type-argument tsc--lang-field-id-for-name symbol-name 1 nil] 7 (#$ . 5435)]) #@148 Return the numeric id of NODE-TYPE in LANGUAGE. NODE-TYPE should be a symbol (named nodes) or a string (anonymous nodes). (fn LANGUAGE NODE-TYPE) (defalias 'tsc-lang-node-type-id #[514 "\2119\203 \300\301!\302#\207\300\303#\207" [tsc--lang-type-id-for-name symbol-name :named nil] 6 (#$ . 5730)]) #@94 Convert PATTERNS into a query string that can be passed to `tsc--make-query'. (fn PATTERNS) (defalias 'tsc--stringify-patterns #[257 "\211;\203\207\300!\203\301\302\303\301\304\305\306\307\310###\207\311\312!\207" [sequencep replace-regexp-in-string "\\\\\\." "." "\\\\\\?" "?" mapconcat #[257 "\300\301\"\207" [format "%S"] 4 "\n\n(fn P)"] "\n" error "Invalid patterns"] 11 (#$ . 6039)]) #@741 Create a new query for LANGUAGE from a sequence of S-expression PATTERNS. The query is associated with LANGUAGE, and can only be run on syntax nodes parsed with LANGUAGE. When the query is executed, each captured node is tagged with a symbol, whose name is the corresponding capture name defined in PATTERNS. For example, nodes that are captured as "@function.builtin" will be tagged with the symbol `function.builtin'. This behavior can be customized by the optional function TAG-ASSIGNER, which should return a tag value when given a capture name (without the prefix "@"). If it returns nil, the associated capture name is disabled. See also: `tsc-query-captures' and `tsc-query-matches'. (fn LANGUAGE PATTERNS &optional TAG-ASSIGNER) (defalias 'tsc-make-query #[770 "\300\301!\206\n\302#\207" [tsc--make-query tsc--stringify-patterns intern] 7 (#$ . 6444)]) #@741 Execute QUERY on NODE and return a sequence of matches. Matches are sorted in the order they were found. Each match has the form (PATTERN-INDEX . MATCH-CAPTURES), where PATTERN-INDEX is the 0-based position of the matched pattern within QUERY, and MATCH-CAPTURES is a sequence of captures associated with the match, similar to that returned by `tsc-query-captures'. TEXT-FUNCTION is called to get nodes' texts (for text-based predicates). It should take 2 parameters: (BEG-BYTE END-BYTE), and return the corresponding chunk of text in the source code. If the optional arg CURSOR is non-nil, it is used as the query-cursor to execute QUERY. Otherwise, a newly created query-cursor is used. (fn QUERY NODE TEXT-FUNCTION &optional CURSOR) (defalias 'tsc-query-matches #[1027 "\300\206\301 $\207" [tsc--query-cursor-matches tsc-make-query-cursor] 9 (#$ . 7319)]) #@791 Execute QUERY on NODE and return a sequence of captures. Captures are sorted in the order they appear. Each capture has the form (CAPTURE-TAG . CAPTURED-NODE), where CAPTURE-TAG is a symbol, whose name is the corresponding capture name defined in QUERY (without the prefix "@"). If QUERY was created with a custom tag assigner, CAPTURE-TAG is the value returned by that function instead. See also: `tsc-make-query'. TEXT-FUNCTION is called to get nodes' texts (for text-based predicates). It should take 2 parameters: (BEG-BYTE END-BYTE), and return the corresponding chunk of text in the source code. If the optional arg CURSOR is non-nil, it is used as the query-cursor to execute QUERY. Otherwise, a newly created query-cursor is used. (fn QUERY NODE TEXT-FUNCTION &optional CURSOR) (defalias 'tsc-query-captures #[1027 "\300\206\301 $\207" [tsc--query-cursor-captures tsc-make-query-cursor] 9 (#$ . 8195)]) #@61 Return the pretty-printed string of TREE's sexp. (fn TREE) (defalias 'tsc-pp-to-string #[257 "\300\301\302!!!\207" [pp-to-string read tsc-tree-to-sexp] 5 (#$ . 9122)]) #@273 Return the sequence of steps from the root node to NODE. Each step has the form (CHILD-NODE . NTH), where CHILD-NODE is the node to descend into, and NTH is its 0-based ordinal position within the parent node. If NODE is the root node, the sequence is empty. (fn NODE) (defalias 'tsc--node-steps #[257 "\300\211C\301\242!\211\262\2031\3022&\303C\304\305\306#\"\266\307\310\242B\"0B\262\211\240\210\202\207" [nil tsc-get-parent :tsc-step 0 tsc-mapc-children make-closure #[257 "\302\300\242\"\203\303\304\300\242\301\242B\"\207\301\211\242T\240\207" [V0 V1 tsc-node-eq throw :tsc-step] 5 "\n\n(fn CHILD)"] throw :tsc-is-not-parents-child] 10 (#$ . 9299)]) (define-error 'tsc--invalid-node-step "Cannot follow node step") #@221 Follow STEPS from TREE's root node; return the final node. STEPS should be a sequence of steps, as described by `tsc--node-steps'. If a step cannot be followed, signal a `tsc--invalid-node-step' error. (fn TREE STEPS) (defalias 'tsc--node-from-steps #[514 "\300!\211\203I\211@\211\242\243\301\"\211\204#\302\303 F\"\210\304!\304!\211\232\204<\302\303 F\"\210\266\262\266A\266\202\202\210\207" [tsc-root-node tsc-get-nth-child signal tsc--invalid-node-step tsc-node-type] 18 (#$ . 10049)]) (provide 'tsc)