;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\303\304!\210\303\305!\210\303\306!\210\307\310!\203#\311\312\313\314\315B\"\210\312\316\317\"\210\202B\312\316\320\"\210\312\313\314\321B\"\210\312\322\323\"\210\312\324\325\"\210\326 !\327\322\330\"\210\331\332\333\334\335\336\337\340&\210\341\342\343\344\345DD\346\347\350\337\332\351\352& \210\341\353\343\344\354DD\355\347\356\337\332&\210\341\357\343\344\360DD\361\347\356\337\332&\210\341\362\343\344\363DD\364\347\365\337\332&\210\341\366\343\344\367DD\370\347\371\337\332&\210\372\366!\210\341\373\343\344\374DD\375\347\376\337\332&\210\341\377\343\344\201@DD\201A\347\201B\201C\201D\307\201E!\205\316\201F\307\201G!\205\331\201H\201I#BB\337\332&\210\341\201J\343\344\201KDD\201L\347\356\337\332&\207" [lua--rx-bindings rx-constituents lua-rx-constituents require comint newcomment rx fboundp rx-let ((symbol (&rest x) (seq symbol-start (or x) symbol-end)) (ws (* (any " "))) (ws+ (+ (any " "))) (lua-name (symbol (seq (+ (any alpha "_")) (* (any alnum "_"))))) (lua-funcname (seq lua-name (* ws "." ws lua-name) (opt ws ":" ws lua-name))) (lua-funcheader (seq (or (seq (symbol "function") ws (group-n 1 lua-funcname)) (seq (group-n 1 lua-funcname) ws "=" ws (symbol "function"))))) (lua-number (seq (or (seq (+ digit) (opt ".") (* digit)) (seq (* digit) (opt ".") (+ digit))) (opt (regexp "[eE][+-]?[0-9]+")))) (lua-assignment-op (seq "=" (or buffer-end (not (any "="))))) (lua-operator (or "+" "-" "*" "/" "%" "^" "#" "==" "~=" "<=" ">=" "<" ">" "=" ";" ":" "," "." ".." "...")) (lua-keyword-operator (symbol "and" "not" "or")) (lua-keyword (symbol "break" "do" "else" "elseif" "end" "for" "function" "goto" "if" "in" "local" "repeat" "return" "then" "until" "while")) (lua-up-to-9-variables (seq (group-n 1 lua-name) ws (32 "," ws (group-n 2 lua-name) ws (32 "," ws (group-n 3 lua-name) ws (32 "," ws (group-n 4 lua-name) ws (32 "," ws (group-n 5 lua-name) ws (32 "," ws (group-n 6 lua-name) ws (32 "," ws (group-n 7 lua-name) ws (32 "," ws (group-n 8 lua-name) ws (32 "," ws (group-n 9 lua-name) ws))))))))))) defalias lua-rx macro #[128 "\301\302\303BE!\207" [lua--rx-bindings eval rx-let rx] 6 "\n\n(fn &rest REGEXPS)"] lua-rx-to-string #[513 "\302!\303\")\207" [lua--rx-bindings rx--local-definitions rx--extend-local-defs rx-to-string] 5 "\n\n(fn FORM &optional NO-GROUP)"] #[513 "\302\")\207" [lua-rx-constituents rx-constituents rx-to-string] 5 "Lua-specific replacement for `rx-to-string'.\n\nSee `rx-to-string' documentation for more information FORM and\nNO-GROUP arguments.\n\n(fn FORM &optional NO-GROUP)"] #[128 "\211\204\300\301!\207\211A\203\302\303B\304\"\207\302@\304\"\207" [error "No regexp" lua-rx-to-string and t] 4 "Lua-specific replacement for `rx'.\n\nSee `rx' documentation for more information about REGEXPS param.\n\n(fn &rest REGEXPS)"] lua--new-rx-form #[257 "\211A\211<\203\211@\301=\203\302A@\303\"\241\210B\211\207" [lua-rx-constituents :rx lua-rx-to-string nogroup] 6 "Add FORM definition to `lua-rx' macro.\n\nFORM is a cons (NAME . DEFN), see more in `rx-constituents' doc.\nThis function enables specifying new definitions using old ones:\nif DEFN is a list that starts with `:rx' symbol its second\nelement is itself expanded with `lua-rx-to-string'. \n\n(fn FORM)"] lua--rx-symbol #[257 "\211A\262\211G\301=\203\211@\202\302\303\"\262\304\305!\205&\305\306\307\310BBB\"\207" [rx-parent 1 append (or) fboundp rx-form seq symbol-start (symbol-end)] 6 "\n\n(fn FORM)"] copy-sequence mapc ((symbol lua--rx-symbol 1 nil) (ws . "[ ]*") (ws+ . "[ ]+") (lua-name :rx (symbol (regexp "[[:alpha:]_]+[[:alnum:]_]*"))) (lua-funcname :rx (seq lua-name (* ws "." ws lua-name) (opt ws ":" ws lua-name))) (lua-funcheader :rx (seq (or (seq (symbol "function") ws (group-n 1 lua-funcname)) (seq (group-n 1 lua-funcname) ws "=" ws (symbol "function"))))) (lua-number :rx (seq (or (seq (+ digit) (opt ".") (* digit)) (seq (* digit) (opt ".") (+ digit))) (opt (regexp "[eE][+-]?[0-9]+")))) (lua-assignment-op :rx (seq "=" (or buffer-end (not (any "="))))) (lua-operator :rx (or "+" "-" "*" "/" "%" "^" "#" "==" "~=" "<=" ">=" "<" ">" "=" ";" ":" "," "." ".." "...")) (lua-keyword-operator :rx (symbol "and" "not" "or")) (lua-keyword :rx (symbol "break" "do" "else" "elseif" "end" "for" "function" "goto" "if" "in" "local" "repeat" "return" "then" "until" "while")) (lua-up-to-9-variables :rx (seq (group-n 1 lua-name) ws (32 "," ws (group-n 2 lua-name) ws (32 "," ws (group-n 3 lua-name) ws (32 "," ws (group-n 4 lua-name) ws (32 "," ws (group-n 5 lua-name) ws (32 "," ws (group-n 6 lua-name) ws (32 "," ws (group-n 7 lua-name) ws (32 "," ws (group-n 8 lua-name) ws (32 "," ws (group-n 9 lua-name) ws))))))))))) custom-declare-group lua nil "Major mode for editing Lua code." :prefix "lua-" :group languages custom-declare-variable lua-indent-level funcall function #[0 "\300\207" [3] 1] "Amount by which Lua subexpressions are indented." :type integer :safe integerp lua-comment-start #[0 "\300\207" [#1="-- "] 1 #1#] "Default value of `comment-start'." string lua-comment-start-skip #[0 "\300\207" [#2="---*[ ]*"] 1 #2#] "Default value of `comment-start-skip'." lua-default-application #[0 "\300\207" [#3="lua"] 1 #3#] "Default application to run in Lua process.\n\nCan be a string, where it denotes a command to be executed to\nstart Lua process, or a (HOST . PORT) cons, that can be used to\nconnect to Lua process running remotely." (choice (string) (cons string integer)) lua-default-command-switches #[0 "\300C\207" ["-i"] 1] "Command switches for `lua-default-application'.\nShould be a list of strings." (repeat string) make-variable-buffer-local lua-always-show #[0 "\300\207" [t] 1] "*Non-nil means display lua-process-buffer after sending a command." boolean lua-documentation-function #[0 "\300\207" [browse-url] 1] "Function used to fetch the Lua reference manual." radio (function-item browse-url) append eww ((function-item eww)) w3m-browse-url ((function-item w3m-browse-url)) ((function :tag "Other function")) lua-documentation-url #[0 "\300\301!\203\302\207\303\207" [file-readable-p "/usr/share/doc/lua/manual.html" "file:///usr/share/doc/lua/manual.html" "http://www.lua.org/manual/5.1/manual.html"] 2] "URL pointing to the Lua reference manual."] 11) #@24 The active Lua process (defvar lua-process nil (#$ . 6371)) #@53 Buffer used for communication with the Lua process. (defvar lua-process-buffer nil (#$ . 6437)) #@38 (fn PREFIX-KEY-SYM PREFIX-KEY-VAL) (defalias 'lua--customize-set-prefix-key #[514 "\205G\300V\205\301!\300\234L\210\302\303!\205\303 \207" [0 read-kbd-macro fboundp lua-prefix-key-update-bindings] 5 (#$ . 6539)]) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313\314\315& \207" [custom-declare-variable lua-prefix-key funcall function #[0 "\300\207" [#1=""] 1 #1#] "Prefix for all lua-mode commands." :type string :group lua :set lua--customize-set-prefix-key :get (lambda (sym) (let ((val (eval sym))) (if val (single-key-description (eval sym)) "")))] 12) #@29 Keymap for lua-mode's menu. (defvar lua-mode-menu (make-sparse-keymap "Lua") (#$ . 7129)) #@143 Keymap that is used to define keys accessible by `lua-prefix-key'. If the latter is nil, the keymap translates into `lua-mode-map' verbatim. (defvar lua-prefix-mode-map '(keymap (6 . lua-search-documentation) (12 . lua-send-buffer)) (#$ . 7226)) (defvar lua--electric-indent-chars (mapcar 'string-to-char '("}" "]" ")"))) #@34 Keymap used in lua-mode buffers. (defvar lua-mode-map (byte-code "\304 \305\306!\204\307\310\311\"\"\210\312\313\314 B#\210\312\315\316#\210\n\203+\312\317\n! #\210\207\320 \"\210\207" [lua--electric-indent-chars lua-mode-menu lua-prefix-key lua-prefix-mode-map make-sparse-keymap boundp electric-indent-chars mapc make-closure #[257 "\301\300\302\303!!\304#\207" [V0 define-key read-kbd-macro char-to-string lua-electric-match] 6 "\n\n(fn ELECTRIC-CHAR)"] define-key [menu-bar lua-mode] "Lua" [remap backward-up-list] lua-backward-up-list vector set-keymap-parent] 6) (#$ . 7555)) #@109 If t, electric actions (like automatic reindentation) will happen when an electric key like `{' is pressed (defvar lua-electric-flag t (#$ . 8154)) (byte-code "\300\301!\210\302\303\304\305\306DD\307\310\311\312\313&\210\302\314\304\305\315DD\316\310\311\312\313&\207" [make-variable-buffer-local lua-electric-flag custom-declare-variable lua-prompt-regexp funcall function #[0 "\300\207" [#1="[^\n]*\\(>[ ]+\\)+$"] 1 #1#] "Regexp which matches the Lua program's prompt." :type regexp :group lua lua-traceback-line-re #[0 "\300\207" [#2="^\\(?:[ ]*\\|.*>[ ]+\\)\\(?:[^\n ]+:[0-9]+:[ ]*\\)*\\(?:\\([^\n ]+\\):\\([0-9]+\\):\\)"] 1 #2#] "Regular expression that describes tracebacks and errors."] 8) #@56 Buffer-local flag saying if this is a Lua REPL buffer. (defvar lua--repl-buffer-p nil (#$ . 8866)) (byte-code "\300\301!\210\302\303\304\305\306$\210\307\303\306\"\210\302\310\311\305\306$\210\307\310\306\"\210\312\313\314\315\316DD\317\320\321\322\323\324\325& \210\312\326\314\315\327DD\330\320\321\322\323\324\325& \210\312\331\314\315\332DD\333\320\321\322\323\324\325& \210\312\334\314\315\335DD\336\322\323\320\321&\210\312\337\314\315\340DD\341\322\342\320\321&\207" [make-variable-buffer-local lua--repl-buffer-p ad-add-advice compilation-find-file (lua--repl-find-file nil t (advice lambda (marker filename directory &rest formats) "Return Lua REPL buffer when looking for \"stdin\" file in it." (if (and lua--repl-buffer-p (string-equal filename "stdin") (not (file-exists-p (expand-file-name filename (when directory (expand-file-name directory)))))) (setq ad-return-value (current-buffer)) ad-do-it))) around nil ad-activate compilation-goto-locus (lua--repl-goto-locus nil t (advice lambda (msg mk end-mk) "When message points to Lua REPL buffer, go to the message itself.\nUsually, stdin:XX line number points to nowhere." (let ((errmsg-buf (marker-buffer msg)) (error-buf (marker-buffer mk))) (if (and (with-current-buffer errmsg-buf lua--repl-buffer-p) (eq error-buf errmsg-buf)) (progn (compilation-set-window (display-buffer (marker-buffer msg)) msg) (goto-char msg)) ad-do-it)))) custom-declare-variable lua-indent-string-contents funcall function #[0 "\300\207" [nil] 1] "If non-nil, contents of multiline string will be indented.\nOtherwise leading amount of whitespace on each line is preserved." :group lua :type boolean :safe booleanp lua-indent-nested-block-content-align #[0 "\300\207" [t] 1] "If non-nil, the contents of nested blocks are indented to\nalign with the column of the opening parenthesis, rather than\njust forward by `lua-indent-level'." lua-indent-close-paren-align #[0 "\300\207" [t] 1] "If non-nil, close parenthesis are aligned with their open\nparenthesis. If nil, close parenthesis are aligned to the\nbeginning of the line." lua-jump-on-traceback #[0 "\300\207" [t] 1] "*Jump to innermost traceback location in *lua* buffer. When this\nvariable is non-nil and a traceback occurs when running Lua code in a\nprocess, jump immediately to the source code of the innermost\ntraceback location." lua-mode-hook #[0 "\300\207" [nil] 1] "Hooks called when Lua mode fires up." hook] 10) #@48 Start of special region for Lua communication. (defvar lua-region-start (make-marker) (#$ . 11302)) #@46 End of special region for Lua communication. (defvar lua-region-end (make-marker) (#$ . 11408)) #@26 Emacs menu for Lua mode. (defvar lua-emacs-menu '(["Restart With Whole File" lua-restart-with-whole-file t] ["Kill Process" lua-kill-process t] ["Hide Process Buffer" lua-hide-process-buffer t] ["Show Process Buffer" lua-show-process-buffer t] ["Beginning Of Proc" lua-beginning-of-proc t] ["End Of Proc" lua-end-of-proc t] ["Set Lua-Region Start" lua-set-lua-region-start t] ["Set Lua-Region End" lua-set-lua-region-end t] ["Send Lua-Region" lua-send-lua-region t] ["Send Current Line" lua-send-current-line t] ["Send Region" lua-send-region t] ["Send Proc" lua-send-proc t] ["Send Buffer" lua-send-buffer t] ["Search Documentation" lua-search-documentation t]) (#$ . 11510)) (defconst lua--builtins (byte-code "\300\301\302\303\304\305\306#\307#\310Q\207" [("_G" "_VERSION" "assert" "collectgarbage" "dofile" "error" "getfenv" "getmetatable" "ipairs" "load" "loadfile" "loadstring" "module" "next" "pairs" "pcall" "print" "rawequal" "rawget" "rawlen" "rawset" "require" "select" "setfenv" "setmetatable" "tonumber" "tostring" "type" "unpack" "xpcall" "self" ("bit32" "arshift" "band" "bnot" "bor" "btest" "bxor" "extract" "lrotate" "lshift" "replace" "rrotate" "rshift") ("coroutine" "create" "isyieldable" "resume" "running" "status" "wrap" "yield") ("debug" "debug" "getfenv" "gethook" "getinfo" "getlocal" "getmetatable" "getregistry" "getupvalue" "getuservalue" "setfenv" "sethook" "setlocal" "setmetatable" "setupvalue" "setuservalue" "traceback" "upvalueid" "upvaluejoin") ("io" "close" "flush" "input" "lines" "open" "output" "popen" "read" "stderr" "stdin" "stdout" "tmpfile" "type" "write") ("math" "abs" "acos" "asin" "atan" "atan2" "ceil" "cos" "cosh" "deg" "exp" "floor" "fmod" "frexp" "huge" "ldexp" "log" "log10" "max" "maxinteger" "min" "mininteger" "modf" "pi" "pow" "rad" "random" "randomseed" "sin" "sinh" "sqrt" "tan" "tanh" "tointeger" "type" "ult") ("os" "clock" "date" "difftime" "execute" "exit" "getenv" "remove" "rename" "setlocale" "time" "tmpname") ("package" "config" "cpath" "loaded" "loaders" "loadlib" "path" "preload" "searchers" "searchpath" "seeall") ("string" "byte" "char" "dump" "find" "format" "gmatch" "gsub" "len" "lower" "match" "pack" "packsize" "rep" "reverse" "sub" "unpack" "upper") ("table" "concat" "insert" "maxn" "move" "pack" "remove" "sort" "unpack") ("utf8" "char" "charpattern" "codepoint" "codes" "len" "offset")) #[257 "\300<\203 @\202\f\301Q\207" ["\\(?1:\\_<" "\\_>\\)"] 4 "\n\n(fn X)"] #[257 "\211<\203 \300\301A!\302Q\207\303\207" ["\\(?:[ ]*\\.[ ]*\\_<\\(?2:" regexp-opt "\\)\\_>\\)?" ""] 4 "\n\n(fn X)"] "\\(?:^\\|[^:. ]\\|[.][.]\\)[ ]*\\(?:" mapconcat make-closure #[257 "\300!\301!P\207" [V0 V1] 4 "\n\n(fn X)"] "\\|" "\\)"] 9)) #@47 Default expressions to highlight in Lua mode. (defvar lua-font-lock-keywords (byte-code "\301\302\303B\304\305B\306\303B\307\310B\311B\312\313B\314\315B\316\317B\320\321B\322\323B\257 \207" [lua--builtins ("^#!.*$" . font-lock-comment-face) "\\_<\\(?:false\\|nil\\|true\\)\\_>" font-lock-constant-face "\\_<\\(?:break\\|do\\|e\\(?:lse\\(?:if\\)?\\|nd\\)\\|f\\(?:or\\|unction\\)\\|goto\\|i[fn]\\|local\\|re\\(?:peat\\|turn\\)\\|then\\|until\\|while\\)\\_>\\|\\_<\\(?:and\\|not\\|or\\)\\_>" font-lock-keyword-face "::[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>[ ]*::" "\\_\\)\\_>" ((1 font-lock-constant-face)) ((1 font-lock-builtin-face) (2 font-lock-builtin-face nil noerror)) "\\_[ ]+\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?2:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?3:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?4:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?5:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?6:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?7:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?8:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?9:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\)?\\)?\\)?\\)?\\)?\\)?\\)?\\)?" ((1 font-lock-variable-name-face) (2 font-lock-variable-name-face nil noerror) (3 font-lock-variable-name-face nil noerror) (4 font-lock-variable-name-face nil noerror) (5 font-lock-variable-name-face nil noerror) (6 font-lock-variable-name-face nil noerror) (7 font-lock-variable-name-face nil noerror) (8 font-lock-variable-name-face nil noerror) (9 font-lock-variable-name-face nil noerror)) "\\_\\(?:[ ]+\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\(?:[ ]*\\.[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)*\\(?:[ ]*:[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)?\\)?[ ]*([ ]*\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?2:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?3:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?4:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?5:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?6:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?7:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?8:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?9:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\)?\\)?\\)?\\)?\\)?\\)?\\)?\\)?" ((1 font-lock-variable-name-face) (2 font-lock-variable-name-face nil noerror) (3 font-lock-variable-name-face nil noerror) (4 font-lock-variable-name-face nil noerror) (5 font-lock-variable-name-face nil noerror) (6 font-lock-variable-name-face nil noerror) (7 font-lock-variable-name-face nil noerror) (8 font-lock-variable-name-face nil noerror) (9 font-lock-variable-name-face nil noerror)) "\\_[ ]*\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\(?:[ ]*\\.[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)*\\(?:[ ]*:[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)?\\)\\|\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\(?:[ ]*\\.[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)*\\(?:[ ]*:[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)?\\)[ ]*=[ ]*\\_" ((1 font-lock-function-name-face)) "\\_[ ]+\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?2:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?3:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?4:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?5:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?6:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?7:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?8:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?9:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\)?\\)?\\)?\\)?\\)?\\)?\\)?\\)?" ((1 font-lock-variable-name-face) (2 font-lock-variable-name-face nil noerror) (3 font-lock-variable-name-face nil noerror) (4 font-lock-variable-name-face nil noerror) (5 font-lock-variable-name-face nil noerror) (6 font-lock-variable-name-face nil noerror) (7 font-lock-variable-name-face nil noerror) (8 font-lock-variable-name-face nil noerror) (9 font-lock-variable-name-face nil noerror)) "\\(?1:@\\_<\\(?:author\\|copyright\\|description\\|field\\|re\\(?:lease\\|turn\\)\\|\\(?:se\\|usag\\)e\\)\\_>\\)\\|\\(?1:@\\_<\\(?:class\\|name\\|param\\)\\_>\\)[ ]+\\(?2:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)" ((1 font-lock-keyword-face t) (2 font-lock-variable-name-face t noerror))] 12) (#$ . 14226)) #@73 Imenu generic expression for lua-mode. See `imenu-generic-expression'. (defvar lua-imenu-generic-expression (byte-code "\300\301\302BB\303\304\305BBD\207" ["Requires" "\\(?:^\\|;\\)[ ]*\\(?:\\_[ ]*\\)?\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*=[ ]*\\_" (1) nil "\\(?:^\\|;\\)[ ]*\\(?:\\_[ ]*\\)?\\(?:\\_[ ]*\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\(?:[ ]*\\.[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)*\\(?:[ ]*:[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)?\\)\\|\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\(?:[ ]*\\.[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)*\\(?:[ ]*:[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)?\\)[ ]*=[ ]*\\_\\)" (1)] 4) (#$ . 18726)) (defvar lua-sexp-alist '(("then" . "end") ("function" . "end") ("do" . "end") ("repeat" . "until"))) #@46 Abbreviation table used in lua-mode buffers. (defvar lua-mode-abbrev-table nil (#$ . 19561)) (define-abbrev-table 'lua-mode-abbrev-table '(("end" "end" lua-indent-line :system t) ("else" "else" lua-indent-line :system t) ("elseif" "elseif" lua-indent-line :system t))) #@26 `lua-mode' syntax table. (defvar lua-mode-syntax-table (byte-code "\300 p\301\302#\216\303\304 !\210\305\306\307\"\210\305\310\311\"\210\305\312\313\"\210\305\314\313\"\210\305\315\316\"\210\305\317\316\"\210\305\320\316\"\210\305\321\316\"\210\305\322\316\"\210\305\323\316\"\210\305\324\316\"\210\305\325\316\"\210\305\326\316\"\210\300 )\207" [syntax-table make-closure #[0 "r\301q\210\302\300!)\207" [V0 V1 set-syntax-table] 2] set-syntax-table copy-syntax-table modify-syntax-entry 45 ". 12" 10 ">" 39 "\"" 34 43 "." 42 47 94 37 62 60 61 126] 6) (#$ . 19836)) (defvar lua-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [lua-mode-hook variable-documentation put "Hook run after entering Lua mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp lua-mode-map definition-name lua-mode] 4) (defvar lua-mode-map (make-sparse-keymap)) (byte-code "\300\301N\204\302\300\301\303\304!#\210\302\305\306\307#\210\302\305\310\311#\207" [lua-mode-map variable-documentation put purecopy "Keymap for `lua-mode'." lua-mode derived-mode-parent prog-mode custom-mode-group lua] 5) #@218 Major mode for editing Lua code. In addition to any hooks its parent mode `prog-mode' might have run, this mode runs the hook `lua-mode-hook', as the final or penultimate step during initialization. \{lua-mode-map} (defalias 'lua-mode #[0 "\306\300!\210\307\310 \210\311\312\310\313N\203\314\311\313\310\313N#\210\315 !\204'\316 \317 \"\210\320 !\210\321\f!\210 <\306\322!\210\323\306\324!\210\325\306\326!\210\307\306\327!\210\330\306\331!\210\332\306\333!\210\334\306\335!\210=\306\336!\210>\306\337!\210\307\306\340!\210\341 \306\342!\210\307\"\306\343!\210?#\344\345!\203\233\306\345!\210\346%@\"%\347\350!\203\311\344\351!\203\311\352\353!\203\311\352\354!\203\311\355\312)\"\204\311\353\356)!!\210\354\357\312A#\210\344\360!\203\327\n\361PAB0\3113\236\204\367\362\363\311\364\365\366B\"\367\"\364\365\370B\"\367\"\371BBB\"\210)\372\373!\207" [delay-mode-hooks major-mode mode-name lua-mode-map lua-mode-syntax-table lua-mode-abbrev-table make-local-variable t prog-mode lua-mode "Lua" mode-class put keymap-parent set-keymap-parent current-local-map use-local-map set-syntax-table font-lock-defaults (lua-font-lock-keywords nil nil nil nil) syntax-propertize-function lua--propertize-multiline-bounds parse-sexp-lookup-properties indent-line-function lua-indent-line beginning-of-defun-function lua-beginning-of-proc end-of-defun-function lua-end-of-proc comment-start comment-start-skip comment-use-syntax fill-paragraph-function lua--fill-paragraph comment-use-global-state imenu-generic-expression boundp electric-indent-chars append featurep menubar current-menubar fboundp set-buffer-menubar add-menu assoc copy-sequence nil mode-popup-menu " Mode Commands" add-to-list hs-special-modes-alist regexp-opt mapcar car words cdr (nil lua-forward-sexp) run-mode-hooks lua-mode-hook local-abbrev-table lua-comment-start lua-comment-start-skip lua-imenu-generic-expression lua--electric-indent-chars lua-emacs-menu lua-sexp-alist] 8 (#$ . 21066) nil]) (byte-code "\300\301\302\"\210\300\303\304\"\207" [add-to-list auto-mode-alist ("\\.lua\\'" . lua-mode) interpreter-mode-alist ("lua" . lua-mode)] 3) #@52 Insert character and adjust indentation. (fn ARG) (defalias 'lua-electric-match #[257 "\302\303\304!!\210) \203\305 \210\306 \207" [blink-paren-function lua-electric-flag nil self-insert-command prefix-numeric-value lua-indent-line blink-matching-open] 4 (#$ . 23230) "P"]) #@33 (fn &optional JUSTIFY REGION) (defalias 'lua--fill-paragraph #[512 "\212m\204\302 \210\303!\203\304y\210\202\305\306\"*\207" [paragraph-separate fill-paragraph-handle-comment move-to-left-margin looking-at 1 t fill-paragraph] 5 (#$ . 23515)]) (defalias 'lua-prefix-key-update-bindings #[0 "\303\304 !=\203\305 \303\"\210\202 \306 \"\211\262\203 \307 \"\210\n\204)\305 \"\207\310 \311\n!#\207" [lua-prefix-mode-map lua-mode-map lua-prefix-key nil keymap-parent set-keymap-parent rassoc delq define-key vector] 5]) #@141 Changes `lua-prefix-key' properly and updates keymaps This function replaces previous prefix-key binding with a new one. (fn NEW-KEY-STR) (defalias 'lua-set-prefix-key #[257 "\301\300\"\210\302\303\304!\"\210\305 \207" [lua-prefix-key lua--customize-set-prefix-key message "Prefix key set to %S" single-key-description lua-prefix-key-update-bindings] 5 (#$ . 24058) "sNew prefix key (empty string means no key): "]) #@63 Returns true if the point is in a string. (fn &optional POS) (defalias 'lua-string-p #[256 "\212\300!\301\234)\207" [syntax-ppss 3] 3 (#$ . 24484)]) #@255 Return position of the beginning comment delimiter (--). Emacs syntax framework does not consider comment delimiters as part of the comment itself, but for this package it is useful to consider point as inside comment when it is between the two hyphens (defalias 'lua--containing-double-hyphen-start-pos #[0 "`Sf\300=\205\301f\300=\205`S\207" [45 nil] 2 (#$ . 24642)]) #@131 Return position of comment containing current point. If point is not inside a comment, return nil. (fn &optional PARSING-STATE) (defalias 'lua-comment-start-pos #[256 "\211\204\300 \262\3018?\205\3028\203\3038\206\304 \207" [syntax-ppss 3 4 8 lua--containing-double-hyphen-start-pos] 3 (#$ . 25023)]) #@74 Returns true if the point is in a comment or string. (fn &optional POS) (defalias 'lua-comment-or-string-p #[256 "\212\300!\211\301\234\206 \302!\262)\207" [syntax-ppss 3 lua-comment-start-pos] 4 (#$ . 25344)]) #@142 Returns start position of string or comment which contains point. If point is not inside string or comment, return nil. (fn &optional POS) (defalias 'lua-comment-or-string-start-pos #[256 "\212\211\203\211b\210\300!\301\234\206\302 )\207" [syntax-ppss 8 lua--containing-double-hyphen-start-pos] 3 (#$ . 25567)]) (defconst lua-ml-begin-regexp "\\(?:\\(?1:-\\)-\\[\\|\\(?2:\\[\\)\\)\\(?3:=*\\)\\[") #@189 Try to match close-bracket for multiline literal around point. Basically, detect form of close bracket from syntactic information provided at point and re-search-forward to it. (fn END) (defalias 'lua-try-match-multiline-end #[257 "\301 \211\205%\212\211b\210\302!)\205%\303\304\305\306\307!\310\224\203 \310\202!\311#\312#\207" [lua-ml-begin-regexp lua-comment-or-string-start-pos looking-at re-search-forward format "]%s\\(?%s:]\\)" match-string-no-properties 3 1 2 noerror] 7 (#$ . 25978)]) #@170 Try to match multiline open-brackets. Find next opening long bracket outside of any string/comment. If none can be found before reaching LIMIT, return nil. (fn LIMIT) (defalias 'lua-try-match-multiline-begin #[257 "\301\302\303#\211\262\203\304\305\224!\204\207" [lua-ml-begin-regexp nil re-search-forward noerror lua-comment-or-string-start-pos 0] 6 (#$ . 26487)]) #@14 (fn LIMIT) (defalias 'lua-match-multiline-literal-bounds #[257 "\300!\206 \301!\207" [lua-try-match-multiline-end lua-try-match-multiline-begin] 3 (#$ . 26868)]) #@139 Put text properties on beginnings and ends of multiline literals. Intended to be used as a `syntax-propertize-function'. (fn START END) (defalias 'lua--propertize-multiline-bounds #[514 "\212b\210\300!\205)\301\224\203\302\301\224\301\225\303\304$\210\305\224\203\302\305\224\305\225\303\306$\210\202)\207" [lua-match-multiline-literal-bounds 1 put-text-property syntax-table (14) 2 (15)] 7 (#$ . 27042)]) #@81 Indent current line for Lua mode. Return the amount the indentation changed by. (defalias 'lua-indent-line #[0 "\301\211d`Z\302 \210\303 \203\304 \262\202\305\306 ]\262i\232\204*\307 `|\210j\210dZ`V\2037dZb\210)\207" [case-fold-search nil back-to-indentation lua-comment-or-string-p lua-calculate-string-or-comment-indentation 0 lua-calculate-indentation line-beginning-position] 5 (#$ . 27465)]) #@82 This function should be run when point at (current-indentation) is inside string (defalias 'lua-calculate-string-or-comment-indentation #[0 "\302 \203\f\204\f\303 \207\304\305!\212\306 b\210\303 \203)\304\307\310\311\312!\"!\203)\313\202* \\)\207" [lua-indent-string-contents lua-indent-level lua-string-p current-indentation looking-at "\\s *\\(?:--\\)?\\]\\(?1:=*\\)\\]" lua-comment-or-string-start-pos format "--\\[%s\\[" match-string-no-properties 1 0] 7 (#$ . 27883)]) #@63 Return 1 if X is positive, -1 if negative, 0 if zero. (fn X) (defalias 'lua--signum #[257 "\211\300V\203\301\207\211\300W\203\302\207\300\207" [0 1 -1] 3 (#$ . 28370)]) #@204 Return non-nil if point is within LIMIT going forward. With BACKWARD non-nil, return non-nil if point is within LIMIT going backward. If point is beyond limit, move it onto limit. (fn LIMIT BACKWARD) (defalias 'lua--ensure-point-within-limit #[514 "\300`Z!\203 \301\202\302U\203\303\207b\210\304\207" [lua--signum 1 -1 t nil] 5 (#$ . 28551)]) #@169 Move point outside of string if it is inside one. By default, point is placed after the string, with BACKWARD it is placed before the string. (fn &optional BACKWARD) (defalias 'lua--escape-from-string #[256 "\300 \3018\205!\203\3028b\210\202 \303`\304 \305\211\300 \306&\210\307\207" [syntax-ppss 3 8 parse-partial-sexp line-end-position nil syntax-table t] 9 (#$ . 28912) nil]) #@256 Searches for a regular expression in the direction specified. Direction is one of 'forward and 'backward. Matches in comments and strings are ignored. If the regexp is found, returns point position, nil otherwise. (fn DIRECTION REGEXP &optional LIMIT) (defalias 'lua-find-regexp #[770 "\301=\203\n\302\202 \303\304\211\304\305\304?\206\306 \301=?\"\211\262\203w\307#\211\262\203w\310\224\262\310\225\262\311!\204F\311!\203w\312 \3138\203Z\314 \301=?!\266\202q\3158\203p\3168b\210\301=\203p\317\320!\210\210\304\262\202\205|`\266\204)\207" [case-fold-search forward re-search-forward re-search-backward nil t lua--ensure-point-within-limit noerror 0 lua-comment-or-string-p syntax-ppss 3 lua--escape-from-string 4 8 forward-comment 1] 13 (#$ . 29308)]) (defconst lua-block-regexp "\\(\\_<\\(do\\|e\\(?:lse\\(?:if\\)?\\|nd\\)\\|function\\|repeat\\|then\\|until\\)\\_>\\)\\|\\([]()[{}]\\)") #@639 This is a list of block token information blocks. Each token information entry is of the form: KEYWORD FORWARD-MATCH-REGEXP BACKWARDS-MATCH-REGEXP TOKEN-TYPE KEYWORD is the token. FORWARD-MATCH-REGEXP is a regexp that matches all possible tokens when going forward. BACKWARDS-MATCH-REGEXP is a regexp that matches all possible tokens when going backwards. TOKEN-TYPE determines where the token occurs on a statement. open indicates that the token appears at start, close indicates that it appears at end, middle indicates that it is a middle type token, and middle-or-open indicates that it can appear both as a middle or an open type. (defconst lua-block-token-alist '(("do" "\\_" "\\_" middle-or-open) ("function" "\\_" nil open) ("repeat" "\\_" nil open) ("then" "\\_<\\(e\\(lse\\(if\\)?\\|nd\\)\\)\\_>" "\\_<\\(else\\)?if\\_>" middle) ("{" "}" nil open) ("[" "]" nil open) ("(" ")" nil open) ("if" "\\_" nil open) ("for" "\\_" nil open) ("while" "\\_" nil open) ("else" "\\_" "\\_" middle) ("elseif" "\\_" "\\_" middle) ("end" nil "\\_<\\(do\\|function\\|then\\|else\\)\\_>" close) ("until" nil "\\_" close) ("}" nil "{" close) ("]" nil "\\[" close) (")" nil "(" close)) (#$ . 30247)) (defconst lua-indentation-modifier-regexp "\\(\\_<\\(do\\|else\\(?:if\\)?\\|f\\(?:or\\|unction\\)\\|if\\|repeat\\|then\\|while\\)\\_>\\|[([{]\\)\\|\\(\\_<\\(end\\|until\\)\\_>\\|[])}]\\)") #@85 Returns the block token info entry for TOKEN from lua-block-token-alist (fn TOKEN) (defalias 'lua-get-block-token-info #[257 "\301\"\207" [lua-block-token-alist assoc] 4 (#$ . 31744)]) #@78 Returns the relevant match regexp from token info (fn TOKEN-INFO DIRECTION) (defalias 'lua-get-token-match-re #[514 "\211\300\267\202A@\207\3018\207\302\207" [#s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (forward 6 backward 10)) 2 nil] 4 (#$ . 31938)]) #@68 Returns the relevant match regexp from token info (fn TOKEN-INFO) (defalias 'lua-get-token-type #[257 "\3008\207" [3] 3 (#$ . 32242)]) #@79 Move backwards to nearest block begin or end. Returns nil if not successful. (defalias 'lua-backwards-to-block-begin-or-end #[0 "\301\302\"\207" [lua-block-regexp lua-find-regexp backward] 3 (#$ . 32385) nil]) #@409 Find matching open- or close-token for TOKEN in DIRECTION. Point has to be exactly at the beginning of TOKEN, e.g. with | being point {{ }|} -- (lua-find-matching-token-word "}" 'backward) will return -- the first { {{ |}} -- (lua-find-matching-token-word "}" 'backward) will find -- the second {. DIRECTION has to be either 'forward or 'backward. (fn TOKEN &optional DIRECTION) (defalias 'lua-find-matching-token-word #[513 "\301!\302!\206\211\303=\204\211\304=\203\305\202\306\307\"\310\305=\203)\311u\210\3122\335\305=\2039\313=\204E\306=\203J\303=\203J\314\312\310\"\210\315\"\203\333\316\317!\317\224\302\301!!\203f\320\"\204\245\321=\204\207\211\321=\204\207\304=\204\207\211\304=\204\207=\203\224b\203\224\322\"\204\326\203\240b\210\314\312\"\210\266\202J\211\321=\204\266\211\304=\204\266\314\312\"\210\211\304=\203\277\262\262\n\301\n!\262\307\"\262\302!\262\266\202J\2110\207" [lua-indentation-modifier-regexp lua-get-block-token-info lua-get-token-type open middle-or-open forward backward lua-get-token-match-re nil 1 found close throw lua-find-regexp match-string 0 string-match middle lua-find-matching-token-word] 13 (#$ . 32604)]) #@430 Find block begion/end token matching the one at the point. This function moves the point to the token that matches the one at the current point. Returns the point position of the first character of the matching token if successful, nil otherwise. Optional PARSE-START is a position to which the point should be moved first. DIRECTION has to be 'forward or 'backward ('forward by default). (fn &optional PARSE-START DIRECTION) (defalias 'lua-goto-matching-block-token #[512 "\203b\210\302\303 !\205\304\305\306!\"\211\205\211b\262)\207" [case-fold-search lua-indentation-modifier-regexp nil looking-at lua-find-matching-token-word match-string 0] 5 (#$ . 33863)]) #@294 Go to the keyword balancing the one under the point. If the point is on a keyword/brace that starts a block, go to the matching keyword that ends the block, and vice versa. If optional NOREPORT is non-nil, it won't flag an error if there is no block open/close open. (fn &optional NOREPORT) (defalias 'lua-goto-matching-block #[256 "gz\300=\203\301\302!\204\303\302\304\305#\210\306 \211\204!\204!\307\310!\207\207" [119 looking-at "\\_<" re-search-backward nil t lua-goto-matching-block-token error "Not on a block control keyword or brace"] 5 (#$ . 34547) nil]) #@151 Move point back skipping all whitespace and comments. If LIMIT is given, stop at it or before. Return non-nil if moved point. (fn &optional LIMIT) (defalias 'lua-skip-ws-and-comments-backward #[256 "\300 ?\205:`\301 `\206e^\262\211\203]b\210`W\203'\302`Z!\210`W\2030b\210`U?\2058`\266\202\207" [lua-string-p lua-comment-start-pos forward-comment] 6 (#$ . 35127) nil]) #@154 Move point forward skipping all whitespace and comments. If LIMIT is given, stop at it or before. Return non-nil if moved point. (fn &optional LIMIT) (defalias 'lua-skip-ws-and-comments-forward #[256 "\300 ?\205<`\301 `\206d]\262\211\203\211b\210\302\303!\210`W\203)\302`Z!\210`W\2032b\210`U?\205:`\266\202\207" [lua-string-p lua-comment-start-pos forward-comment 1] 6 (#$ . 35522) nil]) #@313 Move 1 line forward/backward and skip all insignificant ws/comment lines. Moves point 1 line forward (or backward) skipping lines that contain no Lua code besides comments. The point is put to the beginning of the line. Returns final value of point as integer or nil if operation failed. (fn &optional BACK) (defalias 'lua-forward-line-skip-blanks #[256 "`\203\300 \210\301 \210\202\302y\210\303 \210\300 \210\304`\"\305V\205!`\207" [beginning-of-line lua-skip-ws-and-comments-backward nil lua-skip-ws-and-comments-forward count-lines 0] 5 (#$ . 35935)]) #@265 Regexp that matches the ending of a line that needs continuation. This regexp starts from eol and looks for a binary operator or an unclosed block intro (i.e. 'for' without 'do' or 'if' without 'then') followed by an optional whitespace till the end of the line. (defconst lua-cont-eol-regexp "\\(?:\\(?1:\\_<\\(and\\|elseif\\|f\\(?:or\\|unction\\)\\|i[fn]\\|local\\|not\\|or\\|return\\|until\\|while\\)\\_>\\)\\|\\(?:^\\|[^-+*/^.=<>~:&|]\\)\\(?2:\\(\\.\\.\\|<[<=]\\|==\\|>[=>]\\|~=\\|[%&*+,./:<=>|~^-]\\)\\)\\)\\s *\\=" (#$ . 36508)) #@355 Regexp that matches a line that continues previous one. This regexp means, starting from point there is an optional whitespace followed by Lua binary operator. Lua is very liberal when it comes to continuation line, so we're safe to assume that every line that starts with a binop continues previous one even though it looked like an end-of-statement. (defconst lua-cont-bol-regexp "\\=\\s *\\(?:\\(?1:\\_<\\(and\\|in\\|not\\|or\\)\\_>\\)\\|\\(?2:\\(\\.\\.\\|<[<=]\\|==\\|>[=>]\\|~=\\|[%&*+,./:<=>|~^-]\\)\\)\\(?:$\\|[^-+*/^.=<>~:&|]\\)\\)" (#$ . 37051)) #@72 Return non-nil if the last token on this line is a continuation token. (defalias 'lua-last-token-continues-p #[0 "\301 \302\212\302\210\303!\210\304\305#\205\306\224\206\307\224\262\211\203G\310\311!\312\230\203G\212\311\225b\210\313d!\210m?\205@\314\315!\206@\314\316!?)\204G\302\262)\207" [lua-cont-eol-regexp line-beginning-position nil lua-skip-ws-and-comments-backward re-search-backward t 1 2 match-string-no-properties 0 "return" forward-comment looking-at "\\_" ";\\|\\_<\\(?:break\\|do\\|e\\(?:lse\\(?:if\\)?\\|nd\\)\\|f\\(?:or\\|unction\\)\\|goto\\|i[fn]\\|local\\|re\\(?:peat\\|turn\\)\\|then\\|until\\|while\\)\\_>"] 6 (#$ . 37614)]) #@73 Return non-nil if the first token on this line is a continuation token. (defalias 'lua-first-token-continues-p #[0 "\301 \212\302 \210\303!\210\304\305#\205\306\224\206\307\224)\207" [lua-cont-bol-regexp line-end-position beginning-of-line lua-skip-ws-and-comments-forward re-search-forward t 1 2] 5 (#$ . 38294)]) #@69 Safe version of lua-backward-up-list that does not signal an error. (defalias 'lua--backward-up-list-noerror #[0 "\3001\301 0\207\210\302\207" [(scan-error) lua-backward-up-list nil] 1 (#$ . 38622)]) #@55 Goto starter/opener of the block that contains point. (defalias 'lua-backward-up-list #[0 "`\301\211\211\211\302\301\303\304\"\211\262\203>\305\306!\262\307!\262\310!\262\311=\203>\312\304\"\211\2050\211b\262\211\262\203>\301\262\202\205C\266\205\206o`\262b\210\313\314\315\316\"\203\\\202^\306\224\316\"\203k\202m\306\225E\"\207" [lua-indentation-modifier-regexp nil t lua-find-regexp backward match-string-no-properties 0 lua-get-block-token-info lua-get-token-type close lua-find-matching-token-word signal scan-error "Block open token not found" eql] 10 (#$ . 38830) nil]) #@68 Return non-nil if looking at token(-s) that forbid continued line. (defalias 'lua--continuation-breaking-line-p #[0 "\212\300\301 !\210\302\303!)\207" [lua-skip-ws-and-comments-forward line-end-position looking-at "\\_<\\(?:do\\|else\\(?:if\\)?\\|for\\|if\\|local\\|repeat\\|then\\|until\\|while\\)\\_>\\|\\_[ ]*\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\(?:[ ]*\\.[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)*\\(?:[ ]*:[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)?\\)\\|\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\(?:[ ]*\\.[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)*\\(?:[ ]*:[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)?\\)[ ]*=[ ]*\\_"] 2 (#$ . 39449)]) #@355 Return non-nil if current lined continues a statement. More specifically, return the point in the line that is continued. The criteria for a continuing statement are: * the last token of the previous line is a continuing op, OR the first token of the current line is a continuing op * the expression is not enclosed by a parentheses/braces/brackets (defalias 'lua-is-continuing-statement-p-1 #[0 "\300\211\211\212\301\302!\262)\205H\303 ?\205H\212\304 \206#\212b\205\"\305 )\211\262\205G\306 \242\211\262\205B\211\307\235\206Bf\310=\205B\211\311\232?\205G)\207" [nil lua-forward-line-skip-blanks back lua--continuation-breaking-line-p lua-first-token-continues-p lua-last-token-continues-p lua--backward-up-list-noerror ("(" "[") 44 "{"] 5 (#$ . 40138)]) #@271 Returns non-nil if the line at PARSE-START should be indented as continuation line. This true is when the line : * is continuing a statement itself * starts with a 1+ block-closer tokens, an top-most block opener is on a continuation line (fn &optional PARSE-START) (defalias 'lua-is-continuing-statement-p #[256 "\212\211\203\211b\210\300\301 \203\302 \203\303 \211\262\204 \211\205!\303 \262)\207" [t lua--goto-line-beginning-rightmost-closer lua--backward-up-list-noerror lua-is-continuing-statement-p-1] 4 (#$ . 40921)]) #@187 Create a pair from FOUND-TOKEN and FOUND-POS for indentation calculation. This is a helper function to lua-calculate-indentation-info. Don't use standalone. (fn FOUND-TOKEN FOUND-POS) (defalias 'lua-make-indentation-info-pair #[514 "\303\230\203\n\304B\207 \203;\305\306\307E\235\203;\212\310 \311d!\210\312\310 \"\313U\2034\314\n!\2044\315iB\2027\304B\262)\207\316\317\320E\235\203H\304\313B\207\321\322D\235\203p\212\310 \323\324\"\205]\211`X\211\203i\325\313B\266\202\202n\304\313B\266\202)\207\326\230\203\230\212\310 \323\324\"\205\203\211`X\211\203\221\327\304BB\266\202\202\226\304B\266\202)\207\330\331\332\333F\235\203\360\212\310 \323\324\"\205\257\211`X`\334\203\275\325\313B\266\204\202\356\335 \210\336 \203\311\202\312\313\262\337\315\340 ZB\341\313U?\205\337\342BC\343\334\344\334 \"C\"\345#BB\266\204)\207\346\235\203\375\337\347\304BE\207\304\350\351 8\203 \202 [B\207" [lua-indent-level lua-indent-nested-block-content-align lua-indentation-modifier-regexp "function" relative "{" "(" "[" line-beginning-position forward-comment count-lines 0 looking-at absolute "if" "for" "while" "until" "elseif" lua-goto-matching-block-token backward remove-matching "else" replace-matching ")" "}" "]" "end" nil back-to-indentation lua-is-continuing-statement-p-1 multiple current-indentation append continued-line delete lua-calculate-indentation-info-1 ((cancel-continued-line)) ("do" "then") (cancel-continued-line) 2 match-data] 15 (#$ . 41467)]) #@752 Add the given indentation info PAIR to the list of indentation INFO-LIST. This function has special case handling for two tokens: remove-matching, and replace-matching. These two tokens are cleanup tokens that remove or alter the effect of a previously recorded indentation info. When a remove-matching token is encountered, the last recorded info, i.e. the car of the list is removed. This is used to roll-back an indentation of a block opening statement when it is closed. When a replace-matching token is seen, the last recorded info is removed, and the cdr of the replace-matching info is added in its place. This is used when a middle-of the block (the only case is 'else') is seen on the same line the block is opened. (fn PAIR INFO-LIST) (defalias 'lua-add-indentation-info-pair #[514 "@\300=\203A\211\203\301@\"\262\211A\262\202 \207@\302=\2030\211@@\303=\203/\211A\207\207@\304=\203:\211A\207@\305=\203GAAB\207\243<\203Q\244\207B\207" [multiple lua-add-indentation-info-pair cancel-continued-line continued-line remove-matching replace-matching] 6 (#$ . 42984)]) #@143 Helper function for `lua-calculate-indentation-info'. Return list of indentation modifiers from point to BOUND. (fn INDENTATION-INFO BOUND) (defalias 'lua-calculate-indentation-info-1 #[514 "\301\302#\203\303\304!\304\224\305\306\"\"\262\266\202\207" [lua-indentation-modifier-regexp lua-find-regexp forward match-string 0 lua-add-indentation-info-pair lua-make-indentation-info-pair] 8 (#$ . 44096)]) #@375 For each block token on the line, computes how it affects the indentation. The effect of each token can be either a shift relative to the current indentation level, or indentation to some absolute column. This information is collected in a list of indentation info pairs, which denote absolute and relative each, and the shift/column to indent to. (fn &optional PARSE-END) (defalias 'lua-calculate-indentation-info #[256 "\301\211\302 \211\262\203\303\304!\210\211`W\203\211b\210\202\305\306 BC\262\307 \210\310\311 ^\"\262\312y\313=\203m`X\203m\302 \203Q@@\314=\204a\314BB\262\202a@@\314=\203a\315[BB\262\310\311 ^\"\262\202-\207" [lua-indent-level nil lua-is-continuing-statement-p lua-forward-line-skip-blanks back absolute current-indentation back-to-indentation lua-calculate-indentation-info-1 line-end-position 1 0 continued-line stop-continued-line] 7 (#$ . 44519)]) #@214 Accumulates the indentation information previously calculated by lua-calculate-indentation-info. Returns either the relative indentation shift, or the absolute column to indent to. (fn REVERSED-INDENTATION-INFO) (defalias 'lua-accumulate-indentation-info #[257 "\300\301C\302C\211\2034\211@\211@\301=\203(@@\301=\203(@@AA\\\241\210\202-\211B\262A\266\202\202\210\303\304\305#\"\210\242\242B\207" [nil relative 0 mapc make-closure #[257 "\211A@\302=\203\300\302\240\210\301\240\207\301\211\242\\\240\207" [V0 V1 absolute] 5 "\n\n(fn X)"]] 9 (#$ . 45433)]) #@296 Return amount by which this line modifies the indentation. Beginnings of blocks add lua-indent-level once each, and endings of blocks subtract lua-indent-level once each. This function is used to determine how the indentation of the following line relates to this one. (fn &optional PARSE-END) (defalias 'lua-calculate-indentation-block-modifier #[256 "\301\212\301\302\303!!\262*\211@\304=\203\211A\305 Z\207\211A\207" [case-fold-search nil lua-accumulate-indentation-info lua-calculate-indentation-info absolute current-indentation] 5 (#$ . 46020)]) #@909 Regular expression that matches left-shifter expression. Left-shifter expression is defined as follows. If a block follows a left-shifter expression, its contents & block-close token should be indented relative to left-shifter expression indentation rather then to block-open token. For example: -- 'local a = ' is a left-shifter expression -- 'function' is a block-open token local a = function() -- block contents is indented relative to left-shifter foobarbaz() -- block-end token is unindented to left-shifter indentation end The following left-shifter expressions are currently handled: 1. local function definition with function block, begin-end 2. function call with arguments block, () or {} 3. assignment/return statement with - table constructor block, {} - function call arguments block, () or {} block - function expression a.k.a. lambda, begin-end block. (defconst lua--left-shifter-regexp "\\(?1:\\_\\|\\(?1:\\_<[_[:alnum:]]+\\(?:\\.[_[:alnum:]]+\\)*\\(?::[_[:alnum:]]+\\)?\\_>[[:blank:]]*\\)[({]\\|\\(?1:.*[^<->~]=[[:blank:]]*\\|\\[[:blank:]]*\\)\\(?:{\\|function\\|(\\|\\(?1:\\_<[_[:alnum:]]+\\(?:\\.[_[:alnum:]]+\\)*\\(?::[_[:alnum:]]+\\)?\\_>[[:blank:]]*\\)[({]\\)" (#$ . 46585)) #@145 Check if point is right after a left-shifter expression. See `lua--left-shifter-regexp' for description & example of left-shifter expression.  (defalias 'lua-point-is-after-left-shifter-p #[0 "\212`\301 \210`U?\205\302!\205\211\303\225U\262)\207" [lua--left-shifter-regexp back-to-indentation looking-at 1] 3 (#$ . 47873)]) #@30 (fn &optional PARSE-START) (defalias 'lua--goto-line-beginning-rightmost-closer #[256 "\302\211\211\211\212\203b\210\303 \262\304 \210\305 \204S\302\211\211`X\203Q\306 !\203Q\307\310\311!!\262\312!\262\313=\204Q\311\224\262\262\311\225b\210\314\303 !\210\302\262\202\266)\205\\b\210\211)\207" [case-fold-search lua-indentation-modifier-regexp nil line-end-position back-to-indentation lua-comment-or-string-p looking-at lua-get-block-token-info match-string 0 lua-get-token-type open forward-comment] 11 (#$ . 48211)]) #@310 Return overriding indentation amount for special cases. If there's a sequence of block-close tokens starting at the beginning of the line, calculate indentation according to the line containing block-open token for the last block-close token in the sequence. If not, return nil. (fn &optional PARSE-START) (defalias 'lua-calculate-indentation-override #[256 "\302\211\211\211\212\303!\211\262\205g\304 \211\262\205g\305\306\307\"@\"\205g`\262\211\310 Z\311 U\204Q@\312\230\203?\304 @\313\235\204Q@\314\230\203N\304 @\315\235\204Q\211b\210 \203e@\316\235\203e\317 \204ei\202g\311 *\207" [case-fold-search lua-indent-close-paren-align nil lua--goto-line-beginning-rightmost-closer lua--backward-up-list-noerror string-match lua-get-token-match-re backward line-beginning-position current-indentation "do" ("while" "for") "then" ("if" "elseif") ("{" "(" "[") lua-point-is-after-left-shifter-p] 9 (#$ . 48765)]) #@62 Return appropriate indentation for current line as Lua code. (defalias 'lua-calculate-indentation #[0 "\212\300 \301 \206\302\303!\203\304!\305 \\\262\206\306\262)\207" [line-beginning-position lua-calculate-indentation-override lua-forward-line-skip-blanks back lua-calculate-indentation-block-modifier current-indentation 0] 4 (#$ . 49705)]) #@78 Lua top level (matches only at the beginning of line) function header regex. (defvar lua--beginning-of-defun-re (lua-rx-to-string '(: bol (32 (symbol "local") ws+) lua-funcheader)) (#$ . 50065)) #@257 Move backward to the beginning of a Lua proc (or similar). With argument, do it that many times. Negative arg -N means move forward to Nth following beginning of proc. Returns t unless search stops due to beginning or end of buffer. (fn &optional ARG) (defalias 'lua-beginning-of-proc #[256 "\211\204\301\262\211\302V\203\303\304\305#\203\211S\262\202\211\302W\2034\306\304\305#\2034\307 \210\211T\262\202\211\302U\207" [lua--beginning-of-defun-re 1 0 re-search-backward nil t re-search-forward beginning-of-line] 5 (#$ . 50267) "P"]) #@247 Move forward to next end of Lua proc (or similar). With argument, do it that many times. Negative argument -N means move back to Nth preceding end of proc. This function just searches for a `end' at the beginning of a line. (fn &optional ARG) (defalias 'lua-end-of-proc #[256 "\211\204\300\262\301\302\303W\203!n\204!\212\304 \210g)\305=\203!\306u\210\303V\203B\307\310\301\302#\2039S\262\302\262\202!\301\262\303\262\202!\303W\203c\311\310\301\302#\203ZT\262\302\262\202B\301\262\303\262\202B\203m\304 \210\301y\210\207" [1 nil t 0 beginning-of-line 125 -1 re-search-forward "^end" re-search-backward] 7 (#$ . 50830) "P"]) (defvar lua-process-init-code (mapconcat 'identity '("local loadstring = loadstring or load" "function luamode_loadstring(str, displayname, lineoffset)" " if lineoffset > 1 then" " str = string.rep('\\n', lineoffset - 1) .. str" " end" "" " local x, e = loadstring(str, '@'..displayname)" " if e then" " error(e)" " end" " return x()" "end") " ")) #@42 Convert string to Lua literal. (fn STR) (defalias 'lua-make-lua-string #[257 "\300 \301\302\"\216\303\304\305\"r\211q\210\301\306\"\216c\210eb\210\307\310\311\305#\203H\312\313!\314\230\2031\315\316!\210\202\312\313!\317\230\203@\315\320!\210\202\315\321\305\"\210\202\322\323 \322Q*\262)\207" [match-data make-closure #[0 "\301\300\302\"\207" [V0 set-match-data evaporate] 3] generate-new-buffer " *temp*" t #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] re-search-forward "[\"'\\ \\\n]" nil match-string 0 "\n" replace-match "\\\\n" " " "\\\\t" "\\\\\\&" "'" buffer-string] 7 (#$ . 51852)]) (defalias 'run-lua 'lua-start-process) #@232 Start a Lua process named NAME, running PROGRAM. PROGRAM defaults to NAME, which defaults to `lua-default-application'. When called interactively, switch to the process buffer. (fn &optional NAME PROGRAM STARTFILE &rest SWITCHES) (defalias 'lua-start-process #[896 "\206:\203@\202\262\206\262\306\307\310\"!\204q\311\312\206, %\313\n!\314 \315\"\210r\nq\210\316\317!\210\320\321\322!\210 \323\324EB\325\323!\210\321\326!\210\327 \204k\330\313p!!\210db\210\202Z\331!\210)\332\333!\205z\334\n!\207" [lua-default-application lua-default-command-switches lua-process-buffer lua-process lua--repl-buffer-p lua-traceback-line-re comint-check-proc format "*%s*" apply make-comint get-buffer-process set-process-query-on-exit-flag nil require compile t make-local-variable compilation-error-regexp-alist 1 2 compilation-shell-minor-mode comint-prompt-regexp lua-prompt-line accept-process-output lua-send-string called-interactively-p any switch-to-buffer lua-prompt-regexp lua-process-init-code] 10 (#$ . 52525) nil]) #@54 Return active Lua process creating one if necessary. (defalias 'lua-get-create-process #[0 "\301 \210\207" [lua-process lua-start-process] 1 (#$ . 53583)]) #@34 Kill Lua process and its buffer. (defalias 'lua-kill-process #[0 "\301!\205 \302!\210\303\211\207" [lua-process-buffer buffer-live-p kill-buffer nil] 2 (#$ . 53746) nil]) #@77 Set start of region for use with `lua-send-lua-region'. (fn &optional ARG) (defalias 'lua-set-lua-region-start #[256 "\206`\301\223\207" [lua-region-start nil] 4 (#$ . 53927) nil]) #@75 Set end of region for use with `lua-send-lua-region'. (fn &optional ARG) (defalias 'lua-set-lua-region-end #[256 "\206`\301\223\207" [lua-region-end nil] 4 (#$ . 54119) nil]) #@116 Send STR plus a newline to the Lua process. If `lua-process' is nil or dead, start a new process first. (fn STR) (defalias 'lua-send-string #[257 "\211\300\301O\302\230\204\211\302P\262\303\304 \"\207" [-1 nil "\n" process-send-string lua-get-create-process] 4 (#$ . 54306)]) #@123 Send current line to the Lua process, found in `lua-process'. If `lua-process' is nil or dead, start a new process first. (defalias 'lua-send-current-line #[0 "\300\301 \302 \"\207" [lua-send-region line-beginning-position line-end-position] 3 (#$ . 54595) nil]) #@73 Send the function definition around point to the Lua process. (fn POS) (defalias 'lua-send-defun #[257 "\212\300 \301\302\"\216\303\304!)\262\203`\202\305 \210`\306 \210`Y\2032W\2032\307\"\266\202\2027\310\311!\266\202)\207" [match-data make-closure #[0 "\301\300\302\"\207" [V0 set-match-data evaporate] 3] looking-at "^function[ ]" lua-beginning-of-proc lua-end-of-proc lua-send-region error "Not on a function definition"] 6 (#$ . 54864) "d"]) #@232 Skip shebang (#!/path/to/interpreter/) line at beginning of buffer. Return a position that is after Lua-recognized shebang line (1st character in file must be ?#) if START is at its beginning. Otherwise, return START. (fn START) (defalias 'lua-maybe-skip-shebang-line #[257 "\214~\210\211e=\203\211f\300=\203\212\211b\210\301y\210`)\202\211)\207" [35 nil] 3 (#$ . 55335)]) #@18 (fn START END) (defalias 'lua-send-region #[514 "\301!\262\302!\303 \206\304 \305\"\306\307\310!\310!$\311!\210\205(\312 \207" [lua-always-show lua-maybe-skip-shebang-line line-number-at-pos buffer-file-name buffer-name buffer-substring-no-properties format "print(''); luamode_loadstring(%s, %s, %s);\n" lua-make-lua-string lua-send-string lua-show-process-buffer] 10 (#$ . 55722) "r"]) (defalias 'lua-prompt-line #[0 "\212\301 \302\303\"\216\304y\210\305!\205\304\225)\262)\207" [comint-prompt-regexp match-data make-closure #[0 "\301\300\302\"\207" [V0 set-match-data evaporate] 3] 0 looking-at] 4]) #@40 Send preset Lua region to Lua process. (defalias 'lua-send-lua-region #[0 "\203 \204\f\302\303!\210\304 \"\207" [lua-region-start lua-region-end error "lua-region not set" lua-send-region] 3 (#$ . 56352) nil]) (defalias 'lua-send-proc 'lua-send-defun) #@35 Send whole buffer to Lua process. (defalias 'lua-send-buffer #[0 "\300ed\"\207" [lua-send-region] 3 (#$ . 56615) nil]) #@51 Restart Lua process and send whole file as input. (defalias 'lua-restart-with-whole-file #[0 "\300 \210\301 \207" [lua-kill-process lua-send-buffer] 1 (#$ . 56740) nil]) #@103 Make sure `lua-process-buffer' is being displayed. Create a Lua process if one doesn't already exist. (defalias 'lua-show-process-buffer #[0 "\300\301\302 !!\207" [display-buffer process-buffer lua-get-create-process] 3 (#$ . 56917) nil]) #@55 Delete all windows that display `lua-process-buffer'. (defalias 'lua-hide-process-buffer #[0 "\301!\205 \302!\207" [lua-process-buffer buffer-live-p delete-windows-on] 2 (#$ . 57162) nil]) #@111 Check if character C is part of a function name. Return nil if C is nil. See `lua-funcname-at-point'. (fn C) (defalias 'lua--funcname-char-p #[257 "\211\205\301\302!\303\304\305#)\266\203\207" [inhibit-changing-match-data "\\`[A-Za-z_.]\\'" string nil t string-match] 8 (#$ . 57361)]) #@41 Get current Name { '.' Name } sequence. (defalias 'lua-funcname-at-point #[0 "\300`Sf!\204\300\301f!\205&\212\302 \303\304\"\216\305\306!\210\307\310!\210\311\312!)\262)\207" [lua--funcname-char-p nil match-data make-closure #[0 "\301\300\302\"\207" [V0 set-match-data evaporate] 3] re-search-backward "\\`\\|[^A-Za-z_.]" re-search-forward "\\([A-Za-z_]+\\(?:\\.[A-Za-z_]+\\)*\\)" match-string-no-properties 1] 4 (#$ . 57660)]) #@53 Search Lua documentation for the word at the point. (defalias 'lua-search-documentation #[0 "\302\303 Q !\207" [lua-documentation-url lua-documentation-function "#pdf-" lua-funcname-at-point] 3 (#$ . 58099) nil]) #@213 Toggle the electric indentation feature. Optional numeric ARG, if supplied, turns on electric indentation when positive, turns it off when negative, and just toggles it when zero or left out. (fn &optional ARG) (defalias 'lua-toggle-electric-state #[256 "\301!\203 \211\302U\203?\202#\211\302W\203\303\202#\211\302V\205#\304\210\305\306\"\207" [lua-electric-flag prefix-numeric-value 0 nil t message "%S"] 4 (#$ . 58321) "P"]) #@44 Forward to block end (fn &optional COUNT) (defalias 'lua-forward-sexp #[256 "\301 \302\303\"\216\206\f\304\305\306\"\307V\205:\310\311w\210\312\313\314\"!\203/\315\304!\316\317\"\266\2023\320\304!\210S\262\202\266\202)\207" [lua-sexp-alist match-data make-closure #[0 "\301\300\302\"\207" [V0 set-match-data evaporate] 3] 1 mapcar car 0 " \n" nil looking-at regexp-opt words match-string lua-find-matching-token-word forward forward-sexp] 8 (#$ . 58768) "p"]) (byte-code "\301\302\303#\210\301\304\305#\210\301\306\307#\210\301\310\311#\210\301\312\313#\210\301\314\315#\210\301\316\317#\210\301\320\321#\210\301\322\323#\210\301\324\325#\210\301\326\327#\210\301\330\331#\210\301\332\333#\210\301\334\335#\210\336\337!\207" [lua-mode-menu define-key [restart-with-whole-file] ("Restart With Whole File" . lua-restart-with-whole-file) [kill-process] ("Kill Process" . lua-kill-process) [hide-process-buffer] ("Hide Process Buffer" . lua-hide-process-buffer) [show-process-buffer] ("Show Process Buffer" . lua-show-process-buffer) [end-of-proc] ("End Of Proc" . lua-end-of-proc) [beginning-of-proc] ("Beginning Of Proc" . lua-beginning-of-proc) [send-lua-region] ("Send Lua-Region" . lua-send-lua-region) [set-lua-region-end] ("Set Lua-Region End" . lua-set-lua-region-end) [set-lua-region-start] ("Set Lua-Region Start" . lua-set-lua-region-start) [send-current-line] ("Send Current Line" . lua-send-current-line) [send-region] ("Send Region" . lua-send-region) [send-proc] ("Send Proc" . lua-send-proc) [send-buffer] ("Send Buffer" . lua-send-buffer) [search-documentation] ("Search Documentation" . lua-search-documentation) provide lua-mode] 4)