;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (require 'matlab-syntax) #@48 List of keywords that are part of code blocks. (defconst matlab-block-keyword-list '(("end" . end) ("function" . decl) ("classdef" . decl) ("arguments" . args) ("properties" . mcos) ("methods" . mcos) ("events" . mcos) ("enumeration" . mcos) ("if" . ctrl) ("elseif" . mid) ("else" . mid) ("ifelse" . mid) ("for" . ctrl) ("parfor" . ctrl) ("while" . ctrl) ("spmd" . ctrl) ("switch" . ctrl) ("case" . case) ("otherwise" . case) ("try" . ctrl) ("catch" . mid) ("break" . keyword) ("continue" . keyword) ("return" . keyword) ("global" . vardecl) ("persistent" . vardecl)) (#$ . 112)) #@73 Keyword table for fast lookups of different keywords and their purpose. (defconst matlab-keyword-table (byte-code "\302\303!\304\305 \"\210)\207" [ans matlab-block-keyword-list matlab-obarray-make 23 mapc #[(elt) "\302@ \"AL\207" [elt ans intern] 3]] 3) (#$ . 698)) #@103 Non nil if WORD is a keyword. If word is a number, it is a match-string index for the current buffer. (defalias 'matlab-keyword-p #[(word) "\247\203 \304!\202\f\305 \n\"\211\205 J*\207" [word local-word matlab-keyword-table sym match-string-no-properties intern-soft] 4 (#$ . 975)]) #@49 Return the type of keyword under point, or nil. (defalias 'matlab-on-keyword-p #[nil "\301`!\3028\206 \3038)?\205$\304\305\212\306\307!\210`)\212\310\307!\210`)\"!\207" [pps syntax-ppss 8 9 matlab-keyword-p buffer-substring-no-properties skip-syntax-backward "w_" skip-syntax-forward] 5 (#$ . 1273)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-on-keyword-p speed -1 put byte-optimizer byte-compile-inline-expand] 5) (defvar matlab-kwt-all nil) (defvar matlab-kwt-decl nil) (defvar matlab-kwt-indent nil) (defvar matlab-kwt-end nil) (defvar matlab-kwt-blocks nil) (defvar matlab-kwt-mcos nil) (defvar matlab-kwt-args nil) (defvar matlab-kwt-vardecl nil) (defvar matlab-kwt-fl-simple nil) #@469 Find keywords that match TYPES and return optimized regexp. TYPES can also be a single symbol that represents a common list of keyword types. These include: all - any kind of keyword decl - declarations, like class or function indent - any keyword that causes an indent end - the end keyword (that causes dedent) blocks - indent and end keywords fl-simple - simple to highilght w/ font lock Caches some found regexp to retrieve them faster. (defalias 'matlab-keyword-regex #[(types) "\306=\204\f\307=\203 \206\201\310\306!\211\207\311\267\202t\n\206\201\310\312!\211\207 \206\201\310\313!\211\207\f\206\201\310\314!\211\207 \206\201\310\315!\211\207\206\201\310\316!\211\207\206\201\310\317!\211\207\206\201\310\320!\211\207\206\201\310\321!\211\2079\203~\310C!\207\310!\207" [types matlab-kwt-all matlab-kwt-decl matlab-kwt-indent matlab-kwt-end matlab-kwt-blocks nil all matlab--keyword-regex #s(hash-table size 8 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (decl 28 indent 38 end 48 blocks 58 fl-simple 68 mcos 80 args 92 vardecl 104)) (decl) (decl ctrl args mcos) (end) (end decl ctrl args mcos) (end decl ctrl mid case keyword vardecl) (mcos) (args) (vardecl) matlab-kwt-fl-simple matlab-kwt-mcos matlab-kwt-args matlab-kwt-vardecl] 2 (#$ . 2002)]) #@64 Find keywords that match TYPES and return an optimized regexp. (defalias 'matlab--keyword-regex #[(types) "\302\303\304 \"\210\305\306\")\207" [lst matlab-block-keyword-list nil mapc #[(C) "\203 A>\205 @\nB\211\207" [types C lst] 2] regexp-opt symbols] 3 (#$ . 3350)]) #@342 Compute and return the line context for the current line of MATLAB code. LEVEL indicates how much information to return. LEVEL of 1 is the most primitive / simplest data. LEVEL of 2 is stuff that is derived from previous lines of code. This function caches computed context onto the line it is for, and will return the cache if it finds it. (defalias 'matlab-compute-line-context #[(level &rest context) "\304 \305\216 \306U\203#\212\307 \210\310 )\211\204\311 \312\n!\210\n)\2021 \313U\2030\314\315 \"\2021\316*\207" [save-match-data-internal level ctxt context match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] 1 back-to-indentation matlab-scan-cache-get matlab-compute-line-context-lvl-1 matlab-scan-cache-put 2 apply matlab-compute-line-context-lvl-2 nil] 4 (#$ . 3635)]) (defconst mlf-ltype 0) (defconst mlf-stype 1) (defconst mlf-point 2) (defconst mlf-indent 3) (defconst mlf-entity-start 4) (defconst mlf-paren-depth 5) (defconst mlf-paren-inner-char 6) (defconst mlf-paren-inner-col 7) (defconst mlf-paren-inner-point 8) (defconst mlf-paren-outer-char 9) (defconst mlf-paren-outer-point 10) (defconst mlf-paren-delta 11) (defconst mlf-end-comment-type 12) (defconst mlf-end-comment-pt 13) #@279 Compute and return the level1 context for the current line of MATLAB code. Level 1 contexts are things quickly derived from `syntax-ppss' and other simple states. Computes multiple styles of line by checking for multiple types of context in a single call using fastest methods. (defalias 'matlab-compute-line-context-lvl-1 #[nil "\212\306 \210\307`!\310 \210\311\312 `\313\211%\212\311`\314 \313\211 %)\315\313`\316 1`2 @3\313\21145\313\21167\3138 @\n@Z9\313\211:;\313\211<= @\317V\203w\212\320\321 8!@b\210`f4i5`6\321 8@\2118f7)\322 8\203\245\323 8\324=\203\245\325\326\327!\203\221\330\202\234\326\331!\203\233\332\202\234\333\334 82\2026l\2046`f\335=\203\325\325\326\336!\203\274\337\202\321\326\340!\203\306\341\202\321\326\342!\203\320\343\202\321\313\20263\317U\203\"\307`!\334 8\206\351\321 8)?\205\344\345\212\346\347!\210`)\212\350\347!\210`)\"!\211=\203\"=\351\267\202\352\2026\337=\2026\353=\2026\3173W\2034\326\354!\2034\355\2026\353\334\n8\211>\204J\f\330=\203J\334 8>>\203n>;>f\335U\203_\325\202l>f\356U\203k\357\202l\360:) \f 123456789:;\257.\207" [ppsbol pps ppsend ltype stype pt beginning-of-line syntax-ppss back-to-indentation parse-partial-sexp point-at-bol nil point-at-eol empty current-indentation 0 last 9 4 7 2 comment looking-at "%}\\s-*$" block-end "%" block-body-prefix block-body 8 37 "%{\\s-*$" block-start "%%" cell-start "%\\(?:\\^\\| \\$\\$\\$\\)" indent-ignore matlab-keyword-p buffer-substring-no-properties skip-syntax-backward "w_" skip-syntax-forward #s(hash-table size 7 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (end 269 decl 274 args 274 mcos 274 ctrl 274 mid 274 case 274)) end code "\\s)" close-paren 46 ellipsis commanddual indent start paren-depth paren-inner-char paren-inner-col paren-inner-point paren-outer-char paren-outer-point paren-delta ec-type ec-col cont-from-prev symval csc] 15 (#$ . 4889)]) #@143 Save excursion, and move point to the line specified by CONTEXT. Takes a lvl1 or lvl2 context. Returns the value from the last part of forms. (defalias 'matlab-with-context-line '(macro . #[(__context &rest forms) "\302\303\304\305\306\307\310DD\310DFED BB\207" [__context forms save-excursion goto-char nth mlf-point if consp car] 8 (#$ . 6871)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-with-context-line lisp-indent-function 1 put edebug-form-spec (form &rest form)] 5) #@74 Return the point at beginning of indentation for line specified by lvl1. (defalias 'matlab-line-point #[(lvl1) " 8\207" [mlf-point lvl1] 2 (#$ . 7386)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-point speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@55 Return the indentation of the line specified by LVL1. (defalias 'matlab-line-indentation #[(lvl1) " 8\207" [mlf-indent lvl1] 2 (#$ . 7689)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-indentation speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@60 Return t if the current line is empty based on LVL1 cache. (defalias 'matlab-line-empty-p #[(lvl1) "@\301=\207" [lvl1 empty] 2 (#$ . 7986)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-empty-p speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@44 Return t if the current line is a comment. (defalias 'matlab-line-comment-p #[(lvl1) "@\301=\207" [lvl1 comment] 2 (#$ . 8279)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-comment-p speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@61 Return t if the current line is a comment w/ no attributes. (defalias 'matlab-line-regular-comment-p #[(lvl1) "@\301=\205\fA@\302=\207" [lvl1 comment nil] 2 (#$ . 8562)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-regular-comment-p speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@65 Return t if the current line is an indentation ignored comment. (defalias 'matlab-line-comment-ignore-p #[(lvl1) "\211@)\302=\205 8\303=\207" [lvl1 mlf-stype comment indent-ignore] 3 (#$ . 8897)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-comment-ignore-p speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@43 Return type type of comment on this line. (defalias 'matlab-line-comment-style #[(lvl1) "\211@)\302=\205 8\207" [lvl1 mlf-stype comment] 3 (#$ . 9259)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-comment-style speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@113 Return column of comment on line, or nil if no comment. All lines that start with a comment end with a comment. (defalias 'matlab-line-end-comment-column #[(lvl1) " 8\303=\205\212\n 8b\210i)\207" [mlf-end-comment-type lvl1 mlf-end-comment-pt comment] 2 (#$ . 9575)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-end-comment-column speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@111 Return star of comment on line, or nil if no comment. All lines that start with a comment end with a comment. (defalias 'matlab-line-end-comment-point #[(lvl1) " 8\303=\205 \n 8\207" [mlf-end-comment-type lvl1 mlf-end-comment-pt comment] 2 (#$ . 10008)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-end-comment-point speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@42 Return if this line ends with a comment. (defalias 'matlab-line-ellipsis-p #[(lvl1) " 8\302=\207" [mlf-end-comment-type lvl1 ellipsis] 2 (#$ . 10426)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-ellipsis-p speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@55 Return if this line ends with command duality string. (defalias 'matlab-line-commanddual-p #[(lvl1) " 8\302=\207" [mlf-end-comment-type lvl1 commanddual] 2 (#$ . 10733)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-commanddual-p speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@58 Return the start of the block comment we are in, or nil. (defalias 'matlab-line-block-comment-start #[(lvl1) "\211@)\303=\205 8\304>\205\n8\207" [lvl1 mlf-stype mlf-entity-start comment (block-start block-end block-body block-body-prefix)] 3 (#$ . 11062)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-block-comment-start speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@39 Return t if the current line is code. (defalias 'matlab-line-code-p #[(lvl1) "@\301=\207" [lvl1 code] 2 (#$ . 11490)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-code-p speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@53 Return t if the current line is code w/ no keyword. (defalias 'matlab-line-boring-code-p #[(lvl1) "@\301=\205 A@?\207" [lvl1 code] 2 (#$ . 11760)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-boring-code-p speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@57 Return t if the current line starts with block keyword. (defalias 'matlab-line-block-start-keyword-p #[(lvl1) "@\301=\207" [lvl1 block-start] 2 (#$ . 12068)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-block-start-keyword-p speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@105 If the current line is a declaration return non-nil. Declarations are things like function or classdef. (defalias 'matlab-line-declaration-p #[(lvl1) "\211@)\302=\205 8\303=\207" [lvl1 mlf-stype block-start decl] 3 (#$ . 12394)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-declaration-p speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@49 Non nil If the current line starts with an end. (defalias 'matlab-line-end-p #[(lvl1) "@\301=\207" [lvl1 end] 2 (#$ . 12786)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-end-p speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@108 Non nil If the current line starts with a middle block keyword. These are keywords like `else' or `catch'. (defalias 'matlab-line-block-middle-p #[(lvl1) "@\301=\205\fA@\302=\207" [lvl1 block-start mid] 2 (#$ . 13064)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-block-middle-p speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@108 Non nil If the current line starts with a middle block keyword. These are keywords like `else' or `catch'. (defalias 'matlab-line-block-case-p #[(lvl1) "@\301=\205\fA@\302=\207" [lvl1 block-start case] 2 (#$ . 13446)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-block-case-p speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@171 Go to the end of the code on the current line. If there is a comment or ellipsis, go to the beginning of that. If the line starts with a comment return nil, otherwise t. (defalias 'matlab-line-end-of-code #[(&optional lvl1) "\204\304\305! 8b\210\211@)\306=\206\211@)\307=?\2052\n8\307=\203/ 8b\207\310 b\207" [lvl1 mlf-point mlf-end-comment-type mlf-end-comment-pt matlab-compute-line-context 1 empty comment point-at-eol] 3 (#$ . 13825)]) #@148 Return non-nil of this line of code needs a semicolon. Move cursor to where the ; should be inserted. Return nil for empty and comment only lines. (defalias 'matlab-line-end-of-code-needs-semicolon-p #[(&optional lvl1) "\204\303\304!\305\212\306`!\307\n8\205\307\n8@b)\204I\211@\310=\205+A@?)\203I\311!\203I\312\313!\210\314\306`!8\204Ih\315U\204I`) \205P b)\207" [lvl1 endpt pps matlab-compute-line-context 1 nil syntax-ppss 9 code matlab-line-end-of-code skip-syntax-backward " " 8 59] 4 (#$ . 14287)]) #@57 Return text for the specific keyword found under point. (defalias 'matlab-line-first-word-text #[(&optional lvl1) "\212 @:\203 @\202 8b\210\302`\212\303\304!\210`)\")\207" [mlf-point lvl1 buffer-substring-no-properties skip-syntax-forward "w_"] 4 (#$ . 14818)]) #@383 Return string name of a declaration on the line. For functions, this is the name of the function. For classes, this is the name of the class. Output is a list of the form: ( NAME DECL-TYPE START END) Where NAME is the name, and DECL-TYPE is one of 'function or 'class START and END are buffer locations around the found name. If the current line is not a declaration, return nil. (defalias 'matlab-line-declaration-name #[(&optional lvl1) "\204\306\307!\211\211@)\310=\205 8\311=)\205\274\312\211\211\211\313 \312\314\216\315 !\210\212!@:\203A@\202B8b\210\316!\317\230\203}\307v\210\320\321!\210\322\323!\210\324\325\"\326Q!\203n\327\225b\210\320\321!\210\322\323!\210\330`\212\320\331!\210`)\202\256\316!\332\230\203\256\307v\210\320\321!\210\322\323!\210\324\333!\203\242\327\225b\210\320\321!\210\322\323!\210\334`\212\320\331!\210`), \205\273 \335 \n\" \nF,\207" [lvl1 mlf-stype end start name type matlab-compute-line-context 1 block-start decl nil syntax-table #[nil "\301!\207" [oldsyntax set-syntax-table] 2] set-syntax-table matlab-line-first-word-text "function" skip-syntax-forward " " forward-comment 10 looking-at "\\(\\[[^]]+]\\|\\w+\\)" "=" 0 function "w_" "classdef" "([^)]+)" classdef buffer-substring-no-properties case-fold-search oldsyntax matlab-navigation-syntax-table mlf-point matlab-fl-opt-whitespace] 5 (#$ . 15092)]) #@67 Non nil If the current line starts with closing paren (any type.) (defalias 'matlab-line-close-paren-p #[(lvl1) "@\301=\207" [lvl1 close-paren] 2 (#$ . 16486)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-close-paren-p speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@55 The current depth of parens at the start of this line (defalias 'matlab-line-paren-depth #[(lvl1) " 8\207" [mlf-paren-depth lvl1] 2 (#$ . 16805)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-paren-depth speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@73 Return the paren character for the parenthetical expression LVL1 is in. (defalias 'matlab-line-close-paren-inner-char #[(lvl1) " 8\207" [mlf-paren-inner-char lvl1] 2 (#$ . 17108)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-close-paren-inner-char speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@69 Return the paren column for the prenthetical expression LVL1 is in. (defalias 'matlab-line-close-paren-inner-col #[(lvl1) " 8\207" [mlf-paren-inner-col lvl1] 2 (#$ . 17456)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-close-paren-inner-col speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@69 Return the paren column for the prenthetical expression LVL1 is in. (defalias 'matlab-line-close-paren-inner-point #[(lvl1) " 8\207" [mlf-paren-inner-point lvl1] 2 (#$ . 17797)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-close-paren-inner-point speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@75 The paren character for the outermost prenthetical expression LVL1 is in. (defalias 'matlab-line-close-paren-outer-char #[(lvl1) " 8\207" [mlf-paren-outer-char lvl1] 2 (#$ . 18144)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-close-paren-outer-char speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@63 The point the outermost parenthetical expression start is at. (defalias 'matlab-line-close-paren-outer-point #[(lvl1) " 8\207" [mlf-paren-outer-point lvl1] 2 (#$ . 18494)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab-line-close-paren-outer-point speed -1 put byte-optimizer byte-compile-inline-expand] 5) (defconst mlf-level1 0) (defconst mlf-previous-command-beginning 1) (defconst mlf-previous-nonempty 2) (defconst mlf-previous-code 3) (defconst mlf-previous-block 4) (defconst mlf-previous-fcn 5) #@876 Compute the level 2 context for the current line of MATLAB code. Level 2 context are things that are derived from previous lines of code. Some of that context is derived from the LVL1 context such as paren depth, and some scaning previous lines of code. LVL1 will be computed if not provided. This function will generate a mostly empty structure, and will fill in context from the PREVIOUS2 input as needed. Empty stats will be computed by accessors on an as needed basis. If PREVIOUS 2 is not provided, it will go back 1 line, scan it for lvl1 data and use that. Empty stats are filled in as t. nil means there is no context, or a lvl1 stat block for the line with that meaning. The returned LVL2 structure will fill out to be a chain of all previous LVL2 outputs up to a context break. The chains will be summarized in slots in the returned list for quick access. (defalias 'matlab-compute-line-context-lvl-2 #[(&optional lvl1 previous2) "\204\306 \212\307\211\211\211\211\211\211\310\203L\307\21188888\311\312!\210\202g\212\313 \210o\203Z\310\202f\314u\210\315\316!\311\317!\210)\204}\310\211\310\211\310\211\202\313\211@)\320=\204\313@\321>\204\3138)\322U\203\263 8)\323=\204\263@\324=\203\313!8\325=\203\313 \f \n\257. \207" [lvl1 tmp prev-fcn1 prev-block1 prev-code1 prev-nonempty matlab-compute-line-context-lvl-1 t nil matlab-scan-stat-inc prev2 beginning-of-line -1 matlab-compute-line-context 1 prev2miss empty (empty comment) 0 ellipsis block-start decl prev-cmd-begin prev-lvl2 prev-lvl1 previous2 mlf-previous-command-beginning mlf-previous-nonempty mlf-previous-code mlf-previous-block mlf-previous-fcn mlf-paren-depth mlf-end-comment-type mlf-stype] 9 (#$ . 19032)]) #@150 Refresh the content of this lvl2 context. Assume ONLY the line this lvl2 context belongs to has changed and we don't have any caches in later lines. (defalias 'matlab-refresh-line-context-lvl2 #[(lvl2 &optional lvl1) "\212 @:\203 @\202 8b\210\n\204\304\305! @ 8=\203( \233\n\241\210 \n\240)\207" [mlf-point lvl2 lvl1 mlf-previous-command-beginning matlab-compute-line-context 1] 3 (#$ . 20843)]) #@155 Return a LVL1 context. If input LVL2 is a level 2 context, return the lvl1 from it. If the input is a lvl1, then return that. If LVL2 is nil, compute it. (defalias 'matlab-get-lvl1-from-lvl2 #[(lvl2) "\203@:\203 @\207\207\301\302!\207" [lvl2 matlab-compute-line-context 1] 2 (#$ . 21257)]) #@47 Return lvl1 ctxt for previous non-empty line. (defalias 'matlab-previous-nonempty-line #[(lvl2) " 8\211\303=\203$\212\304\305!\210\306 \210\307\310!\210\311\312! \233\n\240\210)\202(\304\313!\210\n)\207" [mlf-previous-nonempty lvl2 prev t matlab-scan-stat-inc nonemptymiss beginning-of-line skip-syntax-backward " >" matlab-compute-line-context 1 nonempty] 3 (#$ . 21560)]) #@47 Return lvl1 ctxt for previous non-empty line. (defalias 'matlab-previous-code-line #[(lvl2) " 8\211\303=\203,\212\304\305!\210\306 \210o\204(\307\310!\210\311\312x\210\313\314! \233\n\240\210)\2020\304\315!\210\n)\207" [mlf-previous-code lvl2 prev t matlab-scan-stat-inc codemiss beginning-of-line forward-comment -100000 " \n" nil matlab-compute-line-context 1 code] 3 (#$ . 21946)]) #@47 Return lvl1 ctxt for previous non-empty line. (defalias 'matlab-previous-command-begin #[(lvl2) " 8\211\304=\2033\212\212 \305 !@:\203\305 !@\202\305 !8b\210\306 \210\307\310! \233\n\240\210*\2027\311\312!\210\n)\207" [mlf-previous-command-beginning lvl2 prev mlf-point t matlab-previous-code-line matlab-scan-beginning-of-command matlab-compute-line-context 1 matlab-scan-stat-inc cmdbegin] 4 (#$ . 22345)]) #@322 Return declaration column if the current line is part of a help comment. Use the context CTXT as a lvl1 or lvl2 context to compute. Declarations are things like functions and classdefs. Indentation a help comment depends on the column of the declaration. Optional PT, if non-nil, means return the point instead of column (defalias 'matlab-scan-comment-help-p #[(ctxt &optional pt) "\306\211\n@9\203\n\202\307\n!\n\211@)\310=\205x \205&\311 !\306\212\f\204;\212\312 \210\313\314!\210\315\316!)\317\f\320\"\210\315\316!\211\211\211@)\321=\205U 8\322=)\205w\212 @:\203g @\202h 8b\210\203t`\202v\323 )+*\207" [lvl1 lvl2 ctxt boc-lvl1 c-lvl1 mlf-stype nil matlab-get-lvl1-from-lvl2 comment matlab-previous-code-line beginning-of-line forward-comment -100000 matlab-compute-line-context 1 matlab-scan-beginning-of-command code-only block-start decl current-indentation mlf-point pt] 4 (#$ . 22771)]) #@126 Return the position of the previous line's continuation if there is one. This is true iff the previous line has an ellipsis. (defalias 'matlab-scan-previous-line-ellipsis-p #[nil "\212\302 \210o?\205&\303u\210\304\305 \306 \"\3078\211\205%\310 !@\311U\205% *)\207" [pps csc beginning-of-line -1 parse-partial-sexp point-at-bol point-at-eol 8 syntax-after 11] 4 (#$ . 23703)]) #@262 Return point in buffer at the beginning of this command. This function walks up any preceeding comments, enclosing parens, and skips backward over lines that include ellipsis. If optional CODE-ONLY is specified, it doesn't try to scan over preceeding comments. (defalias 'matlab-scan-beginning-of-command #[(&optional lvl1 code-only) "\204\306\307!\310\n8)b\210 \204J\211\211@)\311=\205-\f8\312>\205- 8)\211\203: b\210\306\307!\313\314\"\211\203J b\210\306\307!\310\204y8)\206]`b\210\315 \211\204m\316\202ub\210\306\307!)\202M\317 \210`*\207" [lvl1 bcs mlf-point code-only mlf-stype mlf-entity-start matlab-compute-line-context 1 nil comment (block-start block-end block-body block-body-prefix) matlab-scan-comment-help-p point matlab-scan-previous-line-ellipsis-p t back-to-indentation found mlf-paren-outer-point prev] 4 (#$ . 24092)]) #@113 Return point in buffer at the end of this command. This function walks down past continuations and open arrays. (defalias 'matlab-scan-end-of-command #[(&optional lvl1) "\204\306\307!\211\211@)\310=\205 8\311>\205\n8)\211\2034 b\210\312\307!\210\306\307!\211\202o\313 \204i\313\210\314 \204X\f8)\315=\203V\307y\210\202X\316m\203^\316 \2048\306\307!\2028*\313\210\317 )\207" [lvl1 mlf-stype mlf-entity-start bcs lvlwalk done matlab-compute-line-context 1 comment (block-start block-end block-body block-body-prefix) forward-comment nil matlab-end-of-outer-list ellipsis t point-at-eol mlf-end-comment-type] 3 (#$ . 24981)]) #@246 Like `matlab-on-keyword-p', but returns a node for block scanning. The elements of the return node are: 0 - type of keyword, like ctrl or decl 1 - text of the keyword 2 - buffer pos for start of keyword 3 - buffer pos for end of keyword (defalias 'matlab--mk-keyword-node #[nil "\212\304\305!\210`)\212\306\305!\210`)\307 \"\310\n!\211\205\" \n F,\207" [start end txt type skip-syntax-backward "w_" skip-syntax-forward buffer-substring-no-properties matlab-keyword-p] 5 (#$ . 25647)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab--mk-keyword-node speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@155 Return non-nil if point is valid for keyword. Returns nil for failing `matlab-valid-keyword-syntax'. Returns nil if preceeding non-whitespace char is `.' (defalias 'matlab--valid-keyword-point #[nil "\301`!\3028\206 \3038)?\2056\212\304\305!\210\304\306!\210h\307U\206$h\310U)\2065\212\311\305!\210\311\306!\210g\310U)?\207" [pps syntax-ppss 8 9 skip-syntax-backward "w" " " 46 61 skip-syntax-forward] 2 (#$ . 26303)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab--valid-keyword-point speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@46 Return PARENT if it is a known parent block. (defalias 'matlab--known-parent-block #[(parent) "?\206 @\301=?\205\207" [parent unknown] 2 (#$ . 26888)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put matlab--known-parent-block speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@119 Return non-nil if NODE is in a valid location. Optional parentblock specifies containing parent block if it is known. (defalias 'matlab--valid-keyword-node #[(&optional node parentblock) "\204(\212\306\307!\210`)\212\310\307!\210`)\311 \n\"\312 !\211\205&\f \nF,\205\211\212\3138b\210\314`!\315 8\206?\316 8)?\205\210\212\306\317!\210\306\320!\210h\321U\206Vh\322U)\206g\212\310\317!\210\310\320!\210g\322U)?\205\210@\323=\203y\324!\202\210@\325=\203\207\326!\202\210\327)\207" [node start end txt type pps skip-syntax-backward "w_" skip-syntax-forward buffer-substring-no-properties matlab-keyword-p 2 syntax-ppss 8 9 "w" " " 46 61 mcos matlab--valid-mcos-keyword-point args matlab--valid-arguments-keyword-point t parentblock] 4 (#$ . 27205)]) #@275 Return non-nil if at a location that is valid for MCOS keywords. This means that the parent block is a classdef. Optional input PARENTBLOCK is a precomputed keyword node representing the current block context point is in. Assume basic keyword checks have already been done. (defalias 'matlab--valid-mcos-keyword-point #[(&optional parentblock) "\212\306\307!\210\306\310!\210n)\205x\211?\206 @\311=?\205 )\203(A@\312\230\207\n\313=\205x\212\306\307!\210\314\315!\210\316 \210\212\306\317!\210`)\212\320\317!\210`)\321 \f\"\322 !\211\205^ \fF,\211A@\312\230\206wA@\323\230\205w\324 U*\207" [parentblock parent matlab-functions-have-end start end txt skip-syntax-backward "w" " " unknown "classdef" class forward-comment -100000 matlab-scan-beginning-of-command "w_" skip-syntax-forward buffer-substring-no-properties matlab-keyword-p "end" current-indentation type prev matlab-indent-level] 5 (#$ . 27986)]) #@318 Return non-nil if at a location that is valid for ARGUMENTS keyword. This means that the parent block is a function, and this is first cmd in the function. Optional input PARENTBLOCK is a precomputed keyword node representing the current block context point is in. Assume basic keyword checks have already been done. (defalias 'matlab--valid-arguments-keyword-point #[(&optional parentblock) "\212\306\307!\210\212\306\307!\210\306\310!\210n)\205\332\211?\206 @\311=?\205# )\206\216\212\312\313!\210\314 \210\315`!\316\n8\206<\317\n8)?\205\215\212\306\307!\210\306\310!\210h\320U\206Sh\321U)\206d\212\322\307!\210\322\310!\210g\321U)?\205\215\212\306\323!\210`)\212\322\323!\210`)\324 \f\"\325 !\211\205\214 \fF,)\211\205\331 A@\326\230\206\331 A@\327\230\205\331\212\330 8b\210\331 \210\212\306\323!\210`)\212\322\323!\210`)\324 \f\"\325 !\211\205\320 \fF,\211A@\332\230*))\207" [parentblock parent pps start end txt skip-syntax-backward "w" " " unknown forward-comment -100000 matlab-scan-beginning-of-command syntax-ppss 8 9 46 61 skip-syntax-forward "w_" buffer-substring-no-properties matlab-keyword-p "function" "end" 2 matlab--scan-block-backward "arguments" type prevblock] 5 (#$ . 28927)]) #@119 Return a block state for current point. If PROVIDEDSTATE is non nil, use that. Return nil if no valid block under pt. (defalias 'matlab--scan-derive-block-state #[(providedstate filter) "\206z\212\306\307!\210`)\212\310\307!\210`)\311 \n\"\312 !\211\205&\f \nF,\211?\206p\313`!\3148\206=\3158)?\205f\212\306\316!\210\306\317!\210h\320U\206Th\321U)\206e\212\310\316!\210\310\317!\210g\321U)??\206p @>??\205y B\211)\207" [providedstate start end txt type thiskeyword skip-syntax-backward "w_" skip-syntax-forward buffer-substring-no-properties matlab-keyword-p syntax-ppss 8 9 "w" " " 46 61 pps filter] 5 (#$ . 30170)]) #@155 Scan for the next keyword of KEYWORD-TYPE and stop. Sets match data to be around the keyword. If nothing is found before LIMIT, then stop and return nil. (defalias 'matlab--scan-next-keyword #[(keyword-type limit) "\304!\305\267\202\306\202\307\202\310\311 \312\n$*\207" [keyword-type regex filter limit matlab-keyword-regex #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (mcos 10 args 14)) matlab--valid-mcos-keyword-point matlab--valid-arguments-keyword-point matlab--valid-keyword-node matlab-re-search-keyword-forward t] 5 (#$ . 30821)]) #@507 Scan forward over 1 MATLAB block construct. Return current state on exit. nil - success non-nil - indicates incomplete scanning Also skips over all nexted block constructs along the way. Assumes cursor is in a valid starting state, otherwise ERROR. If cursor is on a middle-block construct like else, case, ERROR. Optional BOUNDS is a point in the buffer past which we won't scan. Optional STATE is the current parsing state to start from. Use STATE to stop/start block scanning partway through. (defalias 'matlab--scan-block-forward #[(&optional bounds state) "\306\307\"\310\211\311\312!\211\204\313\314!\210\204\315\316!\210\f\203\256\n\204\256\317 \320#\211\204J\320\204\f@@\321=\203db\210\f\210\fA\211\202 @\322=\203Z\f\210\fA\211\202 @\323=\203p\324\f@!\203 \fB\211\202 @\325=\203\206\326\f@!\203 \fB\211\202\204\246 @\321=\203\246\f@@\321=\203\246\f\210\fA\327\224b\210\202 \fB\211\204!\f,\207" [state regex stop thiskeyword blockstate bounds matlab--scan-derive-block-state (decl args mcos ctrl) nil matlab-keyword-regex blocks error "Not on valid block start." skip-syntax-forward "w" matlab-re-search-keyword-forward t decl end mcos matlab--valid-mcos-keyword-point args matlab--valid-arguments-keyword-point 1 matlab-functions-have-end] 6 (#$ . 31419)]) #@109 Like `matlab--scan-block-forward', but cursor is not on a keyword. Instead, travel to end as if on keyword. (defalias 'matlab--scan-block-forward-up #[(&optional bounds) "\302\303 \")\207" [currentstate bounds ((unknown "" 0)) matlab--scan-block-forward] 3 (#$ . 32752)]) #@507 Scan forward over 1 MATLAB block construct. Return current state on exit. nil - success non-nil - indicates incomplete scanning Also skips over all nexted block constructs along the way. Assumes cursor is in a valid starting state, otherwise ERROR. If cursor is on a middle-block construct like else, case, ERROR. Optional BOUNDS is a point in the buffer past which we won't scan. Optional STATE is the current parsing state to start from. Use STATE to stop/start block scanning partway through. (defalias 'matlab--scan-block-backward #[(&optional bounds state) "\306\307\"\310\211\311\312!\211\204\313\314!\210\204\315\316!\210\f\203x\n\204x\317 \320#\211\2044\320\202 @\321=\203C \fB\211\202 @\322=\203Y\323\310!\203\f\210\fA\211\202 @\324=\203o\325\310!\203\f\210\fA\211\202\f\210\fA\211\204!\f,\207" [state regex stop thiskeyword blockstate bounds matlab--scan-derive-block-state (end) nil matlab-keyword-regex blocks error "Not on valid block end." skip-syntax-backward "w" matlab-re-search-keyword-backward t end mcos matlab--valid-mcos-keyword-point args matlab--valid-arguments-keyword-point] 6 (#$ . 33033)]) #@109 Like `matlab--scan-block-forward', but cursor is not on a keyword. Instead, travel to end as if on keyword. (defalias 'matlab--scan-block-backward-up #[(&optional bounds) "\302\303 \")\207" [currentstate bounds ((end "end" 0)) matlab--scan-block-backward] 3 (#$ . 34204)]) #@192 Call `matlab--scan-block-backward-up' until we find a keyword of TYPES. Return a keyword node when a matching node is found. Limit search to within BOUNDS. If keyword not found, return nil. (defalias 'matlab--scan-block-backward-up-until #[(types &optional bounds) "9\203C\306\211`\n\204U \203 @>\204U\307\f!\203)\310\211\202\212\311\312!\210`)\212\313\312!\210`)\314 \"\315!\211\205P F,\202\n\204] \202a b\210\306+\207" [types start done node bounds end nil matlab--scan-block-backward-up t skip-syntax-backward "w_" skip-syntax-forward buffer-substring-no-properties matlab-keyword-p txt type] 5 (#$ . 34486)]) #@185 Like `re-search-forward' but will not match content in strings or comments. If BONUSTEST is a function, use it to test each match if it is valid. If not then skip and keep searching. (defalias 'matlab-re-search-keyword-forward #[(regexp &optional bound noerror bonustest) "\306\211\211\212\n\204\225\204\225 \203` W\203\225\307\f #\211\203\225\310 \2032\310\311!\210\306\211\202\312\313`!8\203Q\3141E\315 0\210\202K\210db\210\311\306\211\202\212\316\317!\210\316\320!\210h\321U\206ch\322U)\204w\212\323\317!\210\323\320!\210g\322U)\203}\306\211\202\203\324 \325\216 *\204\306\211\203 )\n\205\313\nb\210\212\316\326!\210`)\212\323\326!\210`)\327\"\330!\211\205\312F,+\207" [err case-fold-search ans bound regexp noerror nil re-search-forward matlab-end-of-string-or-comment t 9 syntax-ppss (error) matlab-end-of-outer-list skip-syntax-backward "w" " " 46 61 skip-syntax-forward match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] "w_" buffer-substring-no-properties matlab-keyword-p bonustest save-match-data-internal start end txt type] 5 (#$ . 35144)]) #@78 Like `re-search-backward' but will not match content in strings or comments. (defalias 'matlab-re-search-keyword-backward #[(regexp &optional bound noerror) "\306\211\212 \204\253\n\203`\nV\203\253\307 \n\f#\211\203\253\306\310`!\3118\2052\3118b\210\312 \203:\313\314!\210*\203c\312\310`!\3118\205S\3118b\210\312 \203[\313\314!\210*\210\306\211\202\310`!\3158\205u\3158@b)\203\306\211\202\212\316\317!\210\316\320!\210h\321U\206\221h\322U)\204\245\212\323\317!\210\323\320!\210g\322U)\203\306\211\203 ) \205\341 b\210\212\316\324!\210`)\212\323\324!\210`)\325\"\326!\211\205\340F,*\207" [case-fold-search ans bound regexp noerror all-comments nil re-search-backward syntax-ppss 8 t forward-comment -100000 9 skip-syntax-backward "w" " " 46 61 skip-syntax-forward "w_" buffer-substring-no-properties matlab-keyword-p pps start end txt type] 5 (#$ . 36308)]) #@355 Return a context for the block start matching block point is in. assumes pt is NOT on an end. List contains: 0 - type of keyword the end matched. 1 - column the keyword is on. 2 - lvl1 context of line the keyword is on 3 - lvl1 context of line at beginning of cmnd found keyword is in. Items 2 and 3 are likely the same but could be different. (defalias 'matlab-scan-block-start-context #[nil "\212\305 \210\306`!\3078\206\3108)?\205(\311\312\212\313\314!\210`)\212\315\314!\210`)\"!i\316\317!\212\320 !\210\316\317!) \n \fF-\207" [pps keyword column lvl1-match lvl1-bgn matlab--scan-block-backward-up syntax-ppss 8 9 matlab-keyword-p buffer-substring-no-properties skip-syntax-backward "w_" skip-syntax-forward matlab-compute-line-context 1 matlab-scan-beginning-of-command] 5 (#$ . 37244)]) #@103 Cache of recently computed line contexts. Used to speed up repeated queries on the same set of lines. (defvar matlab-scan-temporal-cache nil (#$ . 38064)) (make-variable-buffer-local 'matlab-scan-temporal-cache) #@140 Largest size of the cache. Larger means less computation, but more time scanning. Since the list isn't sorted, not optimizations possible. (defvar matlab-scan-cache-max 10 (#$ . 38283)) #@23 Get a cached context. (defalias 'matlab-scan-cache-get #[nil "` \203\n @8U\204 A\211\204 \203.\n @8U\203.\304\305!\210 @\2023\304\306!\210\307*\207" [matlab-scan-temporal-cache cache pt mlf-point matlab-scan-stat-inc lvl1 lvl1-miss nil] 4 (#$ . 38475)]) #@76 Put a context onto the cache. Make sure the cache doesn't exceed max size. (defalias 'matlab-scan-cache-put #[(ctxt) " B\n \233\206\f\303C\303\241\207" [ctxt matlab-scan-temporal-cache matlab-scan-cache-max nil] 2 (#$ . 38750)]) #@37 Function run in after change hooks. (defalias 'matlab-scan-before-change-fcn #[(start end &optional length) "`\306\212\fb\210\307 )\n\2036\f\n@ 8)X\203&\310\311!\210\202/\n@ B\310\312!\210\nA\211\204 \211+\207" [matlab-scan-temporal-cache newcache cache pt start lvl1 nil point-at-bol matlab-scan-stat-inc flushskip flush mlf-point] 4 (#$ . 38988)]) #@55 Setup use of the indent cache for the current buffer. (defalias 'matlab-scan-setup #[nil "\301\302\303\304#\210\305\211\207" [matlab-scan-temporal-cache add-hook before-change-functions matlab-scan-before-change-fcn t nil] 4 (#$ . 39360) nil]) #@55 Setup use of the indent cache for the current buffer. (defalias 'matlab-scan-disable #[nil "\301\302\303\304#\210\305\211\207" [matlab-scan-temporal-cache remove-hook before-change-functions matlab-scan-before-change-fcn t nil] 4 (#$ . 39611) nil]) #@54 Cache stats for tracking effectiveness of the cache. (defvar matlab-scan-cache-stats nil (#$ . 39867)) #@117 Reset the stats cache. With no arg, disable gathering stats. With arg, enable gathering stats, and flush old stats. (defalias 'matlab-scan-stat-reset #[(&optional arg) "\203\n\302\303\304!\207\303\305!\210\306\307!\211\207" [arg matlab-scan-cache-stats nil message "Disable matlab scanner stats gathering." "Emable matlab scanner stats gathering." matlab-obarray-make 13] 2 (#$ . 39977) "P"]) #@43 Increment the stat associated with thing. (defalias 'matlab-scan-stat-inc #[(thing) "\205 \303\304 !\"\211\204\305\304 !\"\211\306L\210\n\211JTL)\207" [matlab-scan-cache-stats thing sym intern-soft symbol-name intern 0] 4 (#$ . 40380)]) #@33 Display stats for scanner hits. (defalias 'matlab-scan-stats-print #[(&optional summary) "\306\307\310 \"\210\311\312\"\n\203 ?\205o\313\314\315\316#!\202o\317 \2034\320\321!\210\322\f\"\210\320\323!\202n r\324\325!q\210p\326 \210\306\211\327\211 \327!\"\330 \210\331\332!\210+\211#$\320\333!\210\322\f\"\334#!\210+))\207" [res matlab-scan-cache-stats summary noninteractive printfcn default-directory nil mapatoms #[(sym) "\302!JB B\211\207" [sym res symbol-name] 2] sort #[(a b) "@ @\231\207" [a b] 2] message mapconcat #[(pair) "@\301\302\303A\"Q\207" [pair ":" format "%d"] 5] " " #[(pair) "\301\302\303@\304P\"\305\302\306A\"\307R!\207" [pair princ format "%-8s" ":" " " "%d" "\n"] 6] princ "\nCache Key Hits\n" mapc "---\n" get-buffer-create "*MATLAB SCANNER STATS*" kill-all-local-variables t erase-buffer run-hooks temp-buffer-setup-hook "Cache Key Hits\n---------- ------\n" internal-temp-output-buffer-show #1=#:old-dir buffer-read-only buffer-file-name buffer-undo-list inhibit-modification-hooks inhibit-read-only #2=#:buf standard-output] 6 (#$ . 40631) "P"]) #@184 Describe the indentation context for the current line. If optional LVL1 is specified, describe that instead of computing. If optional NODISP, then don't display, just return the msg. (defalias 'matlab-describe-line-indent-context #[(&optional lvl1 nodisp) "\306 \210\307 \206\f\310\311!\n 8\312\313 \206\314\"\312\313 \204$\315\202C \314U\203.\315\202C \316U\2038\317\202C \320U\203B\321\202C\322\"\312\323\f+ 8 $,- 8\211.\203b\312\313.\"\202c\307/.\204n\307\202\223\312\313.\314U\203{\315\202\222.\316U\203\206\317\202\222.\320U\203\221\321\202\222\322\"0\307\21112\307\21134+ 8\324U\203\271\325\f\326\327#\325 \326\327#\202\352+ 8\311X\203\313\307\211/0\202\352+ 8\330V\203\352/\331\332\333\334\"!P/\331\332\333\334\"!0P05 8\324W\203\312\335\3365 8!\"3\2025 8\324V\203\312\3375 8\"4\312\3406 8\312\3417 8\206#\307\"8 83/,049 8\342=\203?\343\202Z9 8\344=\203L\345\202Z9 8\346=\203Y\347\202Z\307 9 8\342=\205n\212: 8b\210i))\203\215\312\350 9 8\342=\205\210\212: 8b\210i))\"\202\216\307& . ;\203\234\202\240\351\352\"*\207" [MSG1 lvl1 mlf-paren-inner-char paren-inner-char open close back-to-indentation "" matlab-compute-line-context 1 format "%c" 40 41 91 93 123 125 63 "%s%d%s" 0 propertize face shadow 2 string decode-char ucs 8230 "<%d" abs "%d>" "%s%s >>%d %s%s%s%s%s %s %s" " %s" comment "%" ellipsis "..." commanddual "-command dual" " %d" message "%s" mlf-paren-depth innerparenstr mlf-paren-outer-char outerp-char outerp-open outerp-close outerparenopen outerparenclose extraopen extraclose mlf-paren-delta mlf-ltype mlf-stype mlf-indent mlf-end-comment-type mlf-end-comment-pt nodisp] 16 (#$ . 41747) nil]) (provide 'matlab-scan)