;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (require 'matlab-compat) #@137 Non-nil means to support command dual for indenting and syntax highlight. Does not work well in classes with properties with datatypes. (defvar matlab-syntax-support-command-dual t (#$ . 113)) (byte-code "\300\301!\210\302\301\303\304#\207" [make-variable-buffer-local matlab-syntax-support-command-dual put safe-local-variable booleanp] 4) #@21 MATLAB syntax table (defvar matlab-syntax-table (byte-code "\301\302 !\303\304\305#\210\303\306\307#\210\303\310\311#\210\303\312\313#\210\303\314\315#\210\303\316\315#\210\303\317\320#\210\303\321\322#\210\303\323\324#\210\303\325\322#\210\303\326\322#\210\303\327\322#\210\303\330\322#\210\303\331\322#\210\303\332\322#\210\303\333\322#\210\303\334\322#\210\303\335\322#\210\303\336\337#\210\303\340\341#\210\303\342\343#\210\303\344\345#\210)\207" [st make-syntax-table standard-syntax-table modify-syntax-entry 37 "< 13" 123 "(} 2c" 125 "){ 4c" 10 ">" 39 "\"" 34 95 "_" 92 "." 9 " " 43 45 42 47 61 60 62 38 124 40 "()" 41 ")(" 91 "(]" 93 ")["] 4) (#$ . 460)) #@47 The syntax table used when navigating blocks. (defvar matlab-navigation-syntax-table (byte-code "\302!\303\304\305 #\210 )\207" [matlab-syntax-table st copy-syntax-table modify-syntax-entry 95 "w"] 4) (#$ . 1153)) #@70 Set the current environment for syntax-navigation and execute FORMS. (defalias 'matlab-navigation-syntax '(macro . #[(&rest forms) "\301\302\303\304\305\304BE\306EE\207" [forms let ((oldsyntax (syntax-table)) (case-fold-search nil)) unwind-protect progn (set-syntax-table matlab-navigation-syntax-table) (set-syntax-table oldsyntax)] 7 (#$ . 1375)])) (byte-code "\300\301\302\303#\304\305\306\"\207" [function-put matlab-navigation-syntax lisp-indent-function 0 add-hook edebug-setup-hook #[nil "\300\301\302\303#\207" [put matlab-navigation-syntax edebug-form-spec def-body] 4]] 4) #@38 At character POS, put text CATEGORY. (defalias 'matlab--put-char-category #[(pos category) "m?\205\302\211T\301 $\210\302\211T\303\304$\207" [pos category put-text-property mcm t] 5 (#$ . 1965)]) #@67 Create a new SYMBOL used as a text property category with SYNTAX. (defalias 'matlab--syntax-symbol '(macro . #[(symbol syntax doc) "\303\304 \nF\305\306D E\307\306D\310FF\207" [symbol syntax doc progn defvar set quote put 'syntax-table] 7 (#$ . 2171)])) (byte-code "\300\301\302\303#\300\207" [function-put matlab--syntax-symbol lisp-indent-function defun] 4) #@56 Syntax placed on end-of-line for unterminated strings. (defvar matlab--command-dual-syntax '(15) (#$ . 2541)) (byte-code "\301\302\300\303#\210\302\300\304\305#\207" [matlab--command-dual-syntax (15) put syntax-table command-dual t] 4) #@56 Syntax placed on end-of-line for unterminated strings. (defvar matlab--unterminated-string-syntax '(15) (#$ . 2785)) (byte-code "\301\302\300\303#\210\302\300\304\305#\207" [matlab--unterminated-string-syntax (15) put syntax-table unterminated t] 4) #@54 Syntax placed on ellipsis to treat them as comments. (defvar matlab--ellipsis-syntax '(11) (#$ . 3043)) (byte-code "\301\302\300\303#\207" [matlab--ellipsis-syntax (11) put syntax-table] 4) #@54 Syntax placed on ellipsis to treat them as comments. (defvar matlab--not-block-comment-syntax '(4 . 125) (#$ . 3241)) (byte-code "\301\302\300\303#\207" [matlab--not-block-comment-syntax (4 . 125) put syntax-table] 4) #@317 Scan region between START and END for unterminated strings. Only scans whole-lines, as MATLAB is a line-based language. If region is not specified, scan the whole buffer. See `matlab--scan-line-for-ellipsis', `matlab--san-line-bad-blockcomment', and `matlab--scan-line-for-unterminated-string' for specific details. (defalias 'matlab--syntax-propertize #[(&optional start end) "\304 \305\216\212 \206 eb\210\306 \210\307`\212\n\206db\210\310\210`)\311#\210`\n\206(dY?\205\217m?\205\217 \203K\306 \210\312 \203K\313`\314\"\210\310\210\313`\314\"\210\306 \210\315 \203^\313`\316\"\210\317u\210\202N\306 \210\320 \203n\313`\321\"\210\202a\306 \210\322 \203\206`\313`\323\"\210\310\210\313`\323\"\210)\306 \210\324y\210\202\"+\207" [save-match-data-internal start end matlab-syntax-support-command-dual match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] beginning-of-line remove-text-properties nil (category nil mcm nil) matlab--scan-line-for-command-dual matlab--put-char-category matlab--command-dual-syntax matlab--scan-line-for-ellipsis matlab--ellipsis-syntax 3 matlab--scan-line-bad-blockcomment matlab--not-block-comment-syntax matlab--scan-line-for-unterminated-string matlab--unterminated-string-syntax 1] 4 (#$ . 3468)]) #@56 Functions that are commonly used with commandline dual (defconst matlab-syntax-commanddual-functions '("warning" "disp" "cd" "dbstop" "dbclear" "print" "xlim" "ylim" "zlim" "grid" "hold" "box" "colormap" "axis") (#$ . 4760)) (defconst matlab-cds-regex (regexp-opt matlab-syntax-commanddual-functions 'symbols)) #@50 Scan this line for command line duality strings. (defalias 'matlab--scan-line-for-command-dual #[(&optional debug) "\302\303\304`!8?\205\305\306 \307Q!\205\310\224b)\207" [case-fold-search matlab-cds-regex nil 9 syntax-ppss looking-at "^\\s-*" "\\s-+\\(\\s$\\|\\w\\|\\s_\\)" 2] 4 (#$ . 5077)]) #@47 Treat ' as non-string when used as transpose. (defvar matlab--transpose-syntax '(3) (#$ . 5382)) (byte-code "\301\302\300\303#\207" [matlab--transpose-syntax (3) put syntax-table] 4) #@64 Treat '' or "" as not string delimeteres when inside a string. (defvar matlab--quoted-string-syntax '(9) (#$ . 5573)) (byte-code "\301\302\300\303#\207" [matlab--quoted-string-syntax (9) put syntax-table] 4) #@82 Scan this line for an unterminated string, leave cursor on starting string char. (defalias 'matlab--scan-line-for-unterminated-string #[(&optional debug) "\214\302 \303 }\210\304 \210\3051q\306\307\310\311#\205m\312\313!\313\224\314u\210\315\316!\2030\317 \210\320\321!\210\202in\204E \322\230\204E\212\314u\210\315\323!)\204[\324\321!\210\315 !\203i\325`S\326\"\210b\210\202i \327\230\203f\325`\330\"\210\321u\210*\2020\202s\210\311)\207" [start-char start-str point-at-bol point-at-eol beginning-of-line (error) re-search-forward "\\s\"\\|\\s<" nil t match-string 0 -1 looking-at "\\s<" matlab--scan-line-comment-disable-strings forward-comment 1 "\"" "\\(\\w\\|\\s_\\|\\s)\\|\"\\|\\.\\)" forward-sexp matlab--put-char-category matlab--quoted-string-syntax "'" matlab--transpose-syntax] 4 (#$ . 5789)]) #@127 Disable bad string chars syntax from point to eol. Called when comments found in `matlab--scan-line-for-unterminated-string'. (defalias 'matlab--scan-line-comment-disable-strings #[nil "\212\300\301\302\303#\205\212\304`S\305\"\210)\202)\207" [re-search-forward "\\s\"" nil t matlab--put-char-category matlab--transpose-syntax] 4 (#$ . 6617)]) #@50 Scan this line for invalid block comment starts. (defalias 'matlab--scan-line-bad-blockcomment #[nil "\300\301\302 \303#\205\304\305!?\205\306\225Sb\210\303\207" [re-search-forward "%{" point-at-eol t looking-at "\\s-*$" 0] 4 (#$ . 6971)]) #@33 Scan this line for an ellipsis. (defalias 'matlab--scan-line-for-ellipsis #[nil "\300\301\302 \303#\205\304\224b\210\303\207" [re-search-forward "\\.\\.\\." point-at-eol t 0] 4 (#$ . 7221)]) #@57 Return the face to use for the syntax specified in PPS. (defalias 'matlab--font-lock-syntactic-face #[(pps) "\3018\203\302\3038\304\"\203\305\207\302\3038\306\"\203\307\207\310\207\3038dW\2032\3038Tf\311U\2032\312\207\3038dW\203F\3038Tf\313U\203F\314\207\3038dW\203V\315\316!\203V\317\207\320\207" [pps 3 get-text-property 8 unterminated matlab-unterminated-string-face command-dual matlab-commanddual-string-face font-lock-string-face 37 matlab-cellbreak-face 35 matlab-pragma-face looking-at "\\^\\| \\$\\$\\$" matlab-ignored-comment-face font-lock-comment-face] 3 (#$ . 7420)]) #@103 Integrate our syntax handling into a running `matlab-mode' buffer. Safe to use in `matlab-mode-hook'. (defalias 'matlab-syntax-setup #[nil "\306!\210\307\301!\210\310\307\302!\210\307\303!\210\307\304!\210\307\305!\210\311\312\313\314\307\315!\210\316 P \307\317!\210 \307\320!\210\321\307\322!\210\323\211\207" [matlab-syntax-table syntax-propertize-function comment-start comment-end comment-start-skip page-delimiter set-syntax-table make-local-variable matlab--syntax-propertize "%" "" "%\\s-+" "^\\(\f\\|%%\\(\\s-\\|\n\\)\\)" paragraph-start "^$\\|" paragraph-separate paragraph-ignore-fill-prefix t font-lock-syntactic-face-function matlab--font-lock-syntactic-face] 2 (#$ . 8028)]) #@70 Return non-nil if the cursor is in a valid MATLAB comment or string. (defalias 'matlab-cursor-in-string-or-comment #[nil "\300\301`!8\207" [8 syntax-ppss] 3 (#$ . 8737)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-cursor-in-string-or-comment speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@54 Return t if the cursor is in a valid MATLAB comment. (defalias 'matlab-cursor-in-comment #[nil "\300\301`!8\207" [4 syntax-ppss] 3 (#$ . 9074)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-cursor-in-comment speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@259 Return t if the cursor is in a valid MATLAB character vector or string scalar. Note: INCOMPLETE is now obsolete If the optional argument INCOMPLETE is non-nil, then return t if we are in what could be a an incomplete string. (Note: this is also the default) (defalias 'matlab-cursor-in-string #[(&optional incomplete) "\300\301`!8\207" [3 syntax-ppss] 3 (#$ . 9376)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-cursor-in-string speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@494 Return the comment/string context of cursor for the current line. Return 'comment if in a comment. Return 'string if in a string. Return 'charvector if in a character vector Return 'ellipsis if after an ... ellipsis Return 'commanddual if in text interpreted as string for command dual Return nil if none of the above. Scans from the beginning of line to determine the context. If optional BOUNDS-SYM is specified, set that symbol value to the bounds of the string or comment the cursor is in (defalias 'matlab-cursor-comment-string-context #[(&optional bounds-sym) "\306`!\3078\310\311 \203\220\312 \313\216\212 b\210\3148\315=\2039g\316U\203+\317\202fg\320U\2035\321\202f\322\202f\3148\316=\203E\317\202f\3148\320=\203Q\321\202f\3238\203eg\324U\203a\325\202f\326\202f\311\211\203\217 \203\217 \327>\203~\330`\331\"b\210\202\211\332\331!\210n\203\211\333u\210 `DL\210+ ,\207" [pps start end syntax save-match-data-internal bounds-sym syntax-ppss 8 0 nil match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] 3 t 39 charvector 34 string commanddual 4 37 comment ellipsis (charvector string) scan-sexps 1 forward-comment -1] 4 (#$ . 9900)]) #@112 If the cursor is in a string or comment, move to the beginning. Returns non-nil if the cursor is in a comment. (defalias 'matlab-beginning-of-string-or-comment #[(&optional all-comments) "\302`!\3038\205\3038b\210\304 \203\305\306!\210)\207" [pps all-comments syntax-ppss 8 t forward-comment -100000] 3 (#$ . 11115)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-beginning-of-string-or-comment speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@176 If the cursor is in a string or comment, move to the end. If optional ALL-COMMENTS is non-nil, then also move over all adjacent comments. Returns non-nil if the cursor moved. (defalias 'matlab-end-of-string-or-comment #[(&optional all-comments) "\303`!`\3048\203=\3048b\210\3058\203 \306`\307\"b\210\202,\310\n\203)\311\202*\307!\210` W\2039 b\210\312\313!\210\314\202L\n\205L\315\316!\205L\310\311!\210\314*\207" [pps start all-comments syntax-ppss 8 3 scan-sexps 1 forward-comment 100000 error "Error navitaging syntax." t looking-at "\\s-*\\s<"] 3 (#$ . 11610)]) #@222 Move forwards or backwards up a list by COUNT. When travelling backward, use `syntax-ppss' counted paren starts to navigate upward. When travelling forward, use 'up-list' diretly, but disable comment and string crossing. (defalias 'matlab-up-list #[(count) "\214\304\305`!\306 8\205\306 8b\210\307\203\310\311!\210*\210\n\312W\203G\305 \211@\313\n!W\2036\314\315\313\n!\"\210\316\317 8!\313\n!S 8b*\202L\320\n\304\307#)\207" [all-comments pps count posn nil syntax-ppss 8 t forward-comment -100000 0 abs error "Cannot navigate up %d lists" reverse 9 up-list] 5 (#$ . 12197)]) #@108 If the cursor is in a list, return positions of the beginnings of the lists. Returns nil if not in a list. (defalias 'matlab-in-list-p #[nil "\300\301`!8\207" [9 syntax-ppss] 3 (#$ . 12792)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-in-list-p speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@107 If the cursor is in a list, move to the beginning of outermost list. Returns non-nil if the cursor moved. (defalias 'matlab-beginning-of-outer-list #[nil "\301`!\3028\205\3028@b)\207" [pps syntax-ppss 9] 2 (#$ . 13133)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-beginning-of-outer-list speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@106 If the cursor is in a list, move to the end of the outermost list.. Returns non-nil if the cursor moved. (defalias 'matlab-end-of-outer-list #[nil "\302`!`\303 8\205$\303 8@b\210\304`\305\"b\210`V\205$b\210\306\307!*\207" [start pps syntax-ppss 9 scan-sexps 1 error "Malformed List"] 3 (#$ . 13522)]) #@145 Return non-nil if the current word is treated like a variable. This could mean it is: * Field of a structure * Assigned from or into with = (defalias 'matlab-syntax-keyword-as-variable-p #[nil "\212\300\301!\210\300\302!\210h\303U\206h\304U)\206#\212\305\301!\210\305\302!\210g\304U)\207" [skip-syntax-backward "w" " " 46 61 skip-syntax-forward] 2 (#$ . 13836)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-syntax-keyword-as-variable-p speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@66 Return non-nil if cursor is not in a string, comment, or parens. (defalias 'matlab-valid-keyword-syntax #[nil "\301`!\3028\206 \3038)?\207" [pps syntax-ppss 8 9] 2 (#$ . 14373)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-valid-keyword-syntax speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@45 Move backward COUNT number of MATLAB sexps. (defalias 'matlab-move-simple-sexp-backward-internal #[(count) "\302\303 [!)\207" [forward-sexp-function count nil forward-sexp] 2 (#$ . 14715)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-move-simple-sexp-backward-internal speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@79 Move over one MATLAB sexp COUNT times. If COUNT is negative, travel backward. (defalias 'matlab-move-simple-sexp-internal #[(count) "\302\303 !)\207" [forward-sexp-function count nil forward-sexp] 2 (#$ . 15079)]) (byte-code "\300\301\302\303#\304\301\305\306#\210\307\310!\207" [function-put matlab-move-simple-sexp-internal speed -1 put byte-optimizer byte-compile-inline-expand provide matlab-syntax] 5)