;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (require 'cc-mode) #@71 Regexp matching the start of a ReScript identifier, without grouping. (defconst rescript--name-start-re "[[:alpha:]_$]" (#$ . 106)) #@58 Regexp matching a ReScript identifier, without grouping. (defconst rescript--name-re (concat rescript--name-start-re "\\(?:\\s_\\|\\sw\\)*") (#$ . 244)) #@55 Regexp matching the start of a ReScript object field. (defconst rescript--objfield-re (concat rescript--name-re ":") (#$ . 403)) #@61 Regexp matching a dot-separated sequence of ReScript names. (defconst rescript--dotted-name-re (concat rescript--name-re "\\(?:\\." rescript--name-re "\\)*") (#$ . 538)) #@182 Regexp matching the prefix of a cpp directive. This includes the directive name, or nil in languages without preprocessor support. The first submatch surrounds the directive name. (defconst rescript--opt-cpp-start "^\\s-*#\\s-*\\([[:alnum:]]+\\)" (#$ . 715)) #@79 Like `regexp-opt', but surround the result with `\\_<' and `\\_>'. (fn LIST) (defalias 'rescript--regexp-opt-symbol #[257 "\300\301\302\"\303Q\207" ["\\_<" regexp-opt t "\\_>"] 5 (#$ . 981)]) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313& \210\300\314\302\303\315DD\316\306\307\310\311\312\313& \210\300\317\302\303\320DD\321\306\307\310\311\312\313\322\323& \210\300\324\302\303\325DD\326\306\307\310\311\312\313\322\323& \210\300\327\302\303\330DD\331\306\307\310\311\312\313\322\323& \210\300\332\302\303\333DD\334\306\307\310\311\312\313\322\335& \210\300\336\302\303\337DD\340\306\341\312\313&\210\300\342\302\303\343DD\344\322\345\306\341\310\346\312\313& \210\300\347\302\303\350DD\351\306\303\312\313&\210\300\352\302\303\353DD\354\322\345\306\341\310\346\312\313& \207" [custom-declare-variable rescript-indent-level funcall function #[0 "\300\207" [2] 1] "Number of spaces for each indentation step in `rescript-mode'." :type integer :safe integerp :group rescript rescript-expr-indent-offset #[0 "\300\207" [0] 1] "Number of additional spaces for indenting continued expressions.\nThe value must be no less than minus `rescript-indent-level'." rescript-paren-indent-offset #[0 "\300\207" [0] 1] "Number of additional spaces for indenting expressions in parentheses.\nThe value must be no less than minus `rescript-indent-level'." :version "24.1" rescript-square-indent-offset #[0 "\300\207" [0] 1] "Number of additional spaces for indenting expressions in square braces.\nThe value must be no less than minus `rescript-indent-level'." rescript-curly-indent-offset #[0 "\300\207" [0] 1] "Number of additional spaces for indenting expressions in curly braces.\nThe value must be no less than minus `rescript-indent-level'." rescript-switch-indent-offset #[0 "\300\207" [0] 1] "Number of additional spaces for indenting the contents of a switch block.\nThe value must not be negative." "24.4" rescript-flat-functions #[0 "\300\207" [nil] 1] "Treat nested functions as top-level functions in `rescript-mode'.\nThis applies to function movement, marking, and so on." boolean rescript-indent-align-list-continuation #[0 "\300\207" [t] 1] "Align continuation of non-empty ([{ lines in `rescript-mode'." "26.1" booleanp rescript-comment-lineup-func #[0 "\300\207" [c-lineup-C-comments] 1] "Lineup function for `cc-mode-style', for C comments in `rescript-mode'." rescript-chain-indent #[0 "\300\207" [nil] 1] "Use \"chained\" indentation.\nChained indentation applies when the current line starts with \".\".\nIf the previous expression also contains a \".\" at the same level,\nthen the \".\"s will be lined up:\n\n let x = svg.mumble()\n .chained;\n"] 12) #@87 Helper function for `rescript--re-search-forward'. (fn REGEXP &optional BOUND COUNT) (defalias 'rescript--re-search-forward-inner #[769 "\300\211\212\301 \205\f\302 \210`)\303V\203\202\304\"\210\305 \262\3068\211\262\203>\307=\2030\310\262\304\311\312!P\313 \307#\210\202 \3148\203J\300y\210\202 \3158\204_`Sf\310=\203f\300f\316=\203f\304\317!\210\202 \211\203p`X\204{\301 \203{\302 \210\202 S\262\202 \266`\207" [nil rescript--beginning-of-macro c-end-of-macro 0 re-search-forward syntax-ppss 3 t 47 "\\([^\\]\\|^\\)" string point-at-eol 7 4 42 "\\*/"] 10 (#$ . 3682)]) #@314 Search forward, ignoring strings, cpp macros, and comments. This function invokes `re-search-forward', but treats the buffer as if strings, cpp macros, and comments have been removed. If invoked while inside a macro, it treats the contents of the macro as normal text. (fn REGEXP &optional BOUND NOERROR COUNT) (defalias 'rescript--re-search-forward #[1025 "\211\204\300\262`\301W\203[\262\302\202!\301V\203 \303\202!\304\3051.\211#0\207b\210?\205<\306@A\"\207" [1 0 rescript--re-search-backward-inner rescript--re-search-forward-inner ignore (search-failed) signal] 10 (#$ . 4294)]) #@91 Auxiliary function for `rescript--re-search-backward'. (fn REGEXP &optional BOUND COUNT) (defalias 'rescript--re-search-backward-inner #[769 "\300\212\301 \205`)\302V\203l\303\"\210`eV\203(\212\304u\210\305\306!)\203(\300u\210\307 \262\3108\203:\3108b\210\202 \3118\204O`Sf\312=\203V\300f\313=\203V\303\314!\210\202 \211\203``Y\204e\301 \204 S\262\202 \266`\207" [nil rescript--beginning-of-macro 0 re-search-backward -1 looking-at "/[/*]" syntax-ppss 8 4 47 42 "/\\*"] 8 (#$ . 4909)]) #@314 Search backward, ignoring strings, preprocessor macros, and comments. This function invokes `re-search-backward' but treats the buffer as if strings, preprocessor macros, and comments have been removed. If invoked while inside a macro, treat the macro as normal text. (fn REGEXP &optional BOUND NOERROR COUNT) (defalias 'rescript--re-search-backward #[1025 "\300\203 [\202\301$\207" [rescript--re-search-forward -1] 9 (#$ . 5429)]) #@22 (fn &optional LIM) (defalias 'rescript--beginning-of-macro #[256 "`\214\203\nd}\210\301 \210`S\206`Sf\302=\203 \303y\210\202 \304 \210`X\2033\305!\2033\306\2027\211b\210\307)\207" [rescript--opt-cpp-start beginning-of-line 92 -1 back-to-indentation looking-at t nil] 4 (#$ . 5878)]) #@93 Simple implementation of `c-backward-syntactic-ws' for `rescript-mode'. (fn &optional LIM) (defalias 'rescript--backward-syntactic-ws #[256 "\214\211\203 \211d}\210\212\301 )`\204\301 \210\302!\210``\262U?\205&\202\266\202)\207" [most-negative-fixnum rescript--beginning-of-macro forward-comment] 6 (#$ . 6181)]) #@92 Simple implementation of `c-forward-syntactic-ws' for `rescript-mode'. (fn &optional LIM) (defalias 'rescript--forward-syntactic-ws #[256 "\214\211\203 e}\210`\301!\210\302f\303=\203\304 \210``\262U?\205%\202\n\262)\207" [most-positive-fixnum forward-comment nil 35 c-end-of-macro] 5 (#$ . 6511)]) #@67 Regexp matching keywords optionally followed by an opening brace. (defconst rescript--possibly-braceless-keyword-re (rescript--regexp-opt-symbol '("catch" "else" "finally" "for" "if" "try" "while")) (#$ . 6826)) #@60 Regular expression matching variable declaration keywords. (defconst rescript--declaration-keyword-re "\\<\\(let\\)\\>" (#$ . 7044)) #@77 Regexp matching operators that affect indentation of continued expressions. (defconst rescript--indent-operator-re (byte-code "\300\301\302!P\207" ["[-+*/%<>&^|?:.]\\([^-+*/.]\\|$\\)\\|!?=\\|" rescript--regexp-opt-symbol ("in" "to" "downto")] 3) (#$ . 7183)) #@72 Return non-nil if point is on a ReScript operator, other than a comma. (defalias 'rescript--looking-at-operator-p #[0 "\302 \303\304\"\216\305!\205a\306f\307=\2033\212\310 \210`Sf\311U\203#\312 \210\313\314\306\315#\205/\306f\316=)\205a\306f\317=\205B\212\320\321 8)\317=?\205a\306f\322=\205`\305\323 \324Q!\205`\212\310 \210`Sf\325>)?)\207" [rescript--indent-operator-re rescript--name-re match-data make-closure #[0 "\301\300\302\"\207" [V0 set-match-data evaporate] 3] looking-at nil 58 rescript--backward-syntactic-ws 41 backward-list rescript--re-search-backward "[?:{]\\|\\_" t 63 47 3 syntax-ppss 42 "\\* *\\(?:\\[\\|" " *(\\)" (44 125 123)] 5 (#$ . 7448)]) #@70 Move backward to the nearest newline that is not in a block comment. (defalias 'rescript--find-newline-backward #[0 "\300\211\2031\301\262\302\303\301\300#\203+\304 \3058\203'\3068b\210\3078\204'\300\262\210\202\301\262\202\207" [t nil search-backward "\n" syntax-ppss 4 8 7] 6 (#$ . 8139)]) #@61 Return non-nil if the current line continues an expression. (defalias 'rescript--continued-expression-p #[0 "\212\300 \210\301 \2033\302f\303=\203\304\305`T!8?\306u\210\202a\302f\307>?\206a\310`[!\210`Sf\311>?\202a\312 \205a\313\302x\210o\204C\306u\210`eV\205a\212\306u\210\314\315!)?\205a\301 \205a\306u\210\314\316!?)\207" [back-to-indentation rescript--looking-at-operator-p nil 47 3 syntax-ppss -1 (45 43) forward-comment (44 91 40) rescript--find-newline-backward " " looking-at "[/*]/\\|=>" "\\+\\+\\|--\\|/[/*]"] 3 (#$ . 8452)]) #@59 Skip a term before point; return t if a term was skipped. (defalias 'rescript--skip-term-backward #[0 "\301\302\211\203!\301\262\303\304!\210`Sf\305>\203\302\262\302\262\306 \210\202\210`\303\307!\310W\203<\311!\203<\302\262\303\304!\266\202@\211b\266\211\205Q`eV\205Q\312u\210\301f\313=\207" [rescript--name-re nil t skip-syntax-backward " " (93 41 125) backward-list "w_" 0 looking-at -1 46] 4 (#$ . 9006)]) #@149 Skip any number of terms backward. Move point to the earliest "." without changing paren levels. Returns t if successful, nil if no term was found. (defalias 'rescript--skip-terms-backward #[0 "\300 \205`\300 \203`\262\202\211b\210\301\262\207" [rescript--skip-term-backward t] 2 (#$ . 9440)]) #@416 A helper for rescript--proper-indentation that handles chained expressions. A chained expression is when the current line starts with '.' and the previous line also has a '.' expression. This function returns the indentation for the current line if it is a chained expression line; otherwise nil. This should only be called while point is at the start of the line's content, as determined by `back-to-indentation'. (defalias 'rescript--chained-expression-p #[0 "\205\212\301f\302=\205\303 \205\304 \205\305 \205i)\207" [rescript-chain-indent nil 46 rescript--continued-expression-p rescript--find-newline-backward rescript--skip-terms-backward] 2 (#$ . 9749)]) #@187 Helper function for `rescript--proper-indentation'. Return the proper indentation of the current line if it starts the body of a control statement without braces; otherwise, return nil. (defalias 'rescript--ctrl-statement-indentation #[0 "\212\302 \210\212\303 e=?\205A\304\305!?\205A\306\307\310\311#\205Am\204#\310u\210`Sf\312U\203.\313 \210\314\315!\210\314\316!\210\304!\205A`Sf\317>)\205O\212\320\224b\210\321 \\))\207" [rescript--possibly-braceless-keyword-re rescript-indent-level back-to-indentation point-at-bol looking-at "[{]" rescript--re-search-backward "[[:graph:]]" nil t 41 backward-list skip-syntax-backward " " "w_" (32 9 10 125) 0 current-indentation] 4 (#$ . 10428)]) #@22 (fn SYMBOL ANCHOR) (defalias 'rescript--get-c-offset #[514 "\302BC\303BC!)\207" [rescript-comment-lineup-func c-offsets-alist c c-get-syntactic-indentation] 5 (#$ . 11131)]) #@12 (fn POS) (defalias 'rescript--same-line #[257 "\211\300 Y\205 \211\301 X\207" [point-at-bol point-at-eol] 3 (#$ . 11317)]) #@192 Helper function for `rescript--proper-indentation'. Return the proper indentation of the current line if it belongs to a declaration statement spanning multiple lines; otherwise, return nil. (defalias 'rescript--multi-line-declaration-indentation #[0 "\303\211\212\304 \210\305 !?\205`\305\n!\203\306\225b\210\307\310 8\203$\211b\210\210\211\204so\204s`\212\311 \210`Sf\312=\206[`Sf\313=\204X\314\315!\210\305\n!\311 \210\203X`Sf\313=?\206[\316!)\262\203s\3171l\320 0\210\202%\210\321\262\202%\305 !\205\306\225b\210iT*\207" [forward-sexp-function rescript--declaration-keyword-re rescript--indent-operator-re nil back-to-indentation looking-at 0 3 syntax-ppss rescript--backward-syntactic-ws 44 59 skip-syntax-backward "." rescript--same-line (scan-error) backward-sexp t] 5 (#$ . 11450)]) #@110 Regexp matching the last "=>" (arrow) token on a line. Whitespace and comments around the arrow are ignored. (defconst rescript--line-terminating-arrow-re "=>\\s-*\\(/[/*]\\|$\\)" (#$ . 12270)) #@176 Helper function for `rescript--proper-indentation'. Return non-nil if the last non-comment, non-whitespace token of the current line is the "=>" token (of an arrow function). (defalias 'rescript--broken-arrow-terminates-line-p #[0 "`\301\210\302\303#\207" [rescript--line-terminating-arrow-re nil re-search-backward t] 5 (#$ . 12471)]) #@72 Return the proper indentation for the current line. (fn PARSE-STATUS) (defalias 'rescript--proper-indentation #[257 "\212\306 \210\3078\203\310\311\3128\"\202\357\3138\203\314\202\357\315f\316=\203(\314\202\357\212\317 )\2033\307\202\357\320 \206\357\321 \206\357\322 \206\357\211A@\203\342\323\324!\323\325!\326 A@b\210\203i\323\327!\204i\212\315u\210\330 )\203\321\331\332!\210`Sf\333=\203x\334 \210\306 \210?\205\203\323\335!\206\214\205\214\211i\203\225\314\202\275\203\241\336 _\n\\\202\275 A@f\211\337\267\202\271 \202\272\f\202\272 \202\272\315\262\\\\\203\313\211\"\\\266\206\202\357\211\266\206\202\357\204\334\315u\210\340\315w\210i\266\203\202\357\326 \203\355 \n\\\202\357\341 )\207" [rescript-indent-align-list-continuation rescript-indent-level rescript-expr-indent-offset rescript-paren-indent-offset rescript-square-indent-offset rescript-curly-indent-offset back-to-indentation 4 rescript--get-c-offset c 8 3 0 nil 35 rescript--beginning-of-macro rescript--chained-expression-p rescript--ctrl-statement-indentation rescript--multi-line-declaration-indentation looking-at "[]})]" "default\\_>\\|case\\_>[^:]" rescript--continued-expression-p "[({[]\\s-*\\(/[/*]\\|$\\)" rescript--broken-arrow-terminates-line-p skip-syntax-backward " " 41 backward-list "\\_" 2 #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (40 173 91 177 123 181)) " " prog-first-column rescript-switch-indent-offset] 11 (#$ . 12816)]) #@40 Indent the current line as JavaScript. (defalias 'rescript-indent-line #[0 "\212\300\301 !)`\212\302 \210`)Z\3038?\205#\304\305!!\210\211\306V\205#\211u\207" [syntax-ppss point-at-bol back-to-indentation 3 indent-line-to rescript--proper-indentation 0] 5 (#$ . 14345) nil]) (provide 'rescript-indent)