;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\305\306\307\310\311\312\313\314\315\316& \210\317\320\321\322\323DD\324\313\306\325\326&\210\317\327\321\322\330DD\331\313\306\325\326&\207" [require cl-lib haskell-mode syntax imenu custom-declare-group haskell-decl-scan nil "Haskell declaration scanning (`imenu' support)." :link (custom-manual "(haskell-mode)haskell-decl-scan-mode") :group haskell :prefix "haskell-decl-scan-" custom-declare-variable haskell-decl-scan-bindings-as-variables funcall function #[0 "\300\207" [nil] 1] "Whether to put top-level value bindings into a \"Variables\" category." :type boolean haskell-decl-scan-add-to-menubar #[0 "\300\207" [t] 1] "Whether to add a \"Declarations\" menu entry to menu bar."] 10) #@40 Keywords that may start a declaration. (defvar haskell-ds-start-keywords-re "\\(\\" (#$ . 847)) #@53 Syntax table used for Haskell declaration scanning. (defvar haskell-ds-syntax-table (byte-code "\301!\302\303\304#\210\302\305\304#\210\302\306\307#\210\207" [haskell-mode-syntax-table copy-syntax-table modify-syntax-entry 39 "w" 95 92 "_"] 5) (#$ . 1056)) #@287 Return variable involved in value binding or type signature. Assumes point is looking at the regexp PREFIX followed by the start of a declaration (perhaps in the middle of a series of declarations concerning a single variable). Otherwise return nil. Point is not changed. (fn PREFIX) (defalias 'haskell-ds-get-variable #[257 "\212\302 p\303\304#\216\305!\210\306!\203\307\225b\210\306 !?\205k\306\310!\203+\311\312!\206k\306\313f\314=\203:\315 \210\316\202;\317!\203b\311\320!\211\321\235\203N\311\312!\202]\211\307H\322=\203\\\311\323!\202]\211\262\206k\306\324!\205k\311\307!)\266\202)\207" [haskell-ds-syntax-table haskell-ds-start-keywords-re syntax-table make-closure #[0 "r\301q\210\302\300!)\207" [V0 V1 set-syntax-table] 2] set-syntax-table looking-at 0 "(\\(\\s_+\\))" match-string-no-properties 1 nil 40 forward-sexp "\\(\\'\\)?\\s-*\\(\\s_+\\|`\\(\\sw+\\)`\\)" "\\(\\sw+\\)?\\s-*\\(\\s_+\\|`\\(\\sw+\\)`\\)" 2 ("::" "∷" "=" "|") 96 3 "\\sw+"] 7 (#$ . 1324)]) #@157 Move to beginning of line that succeeds/precedes (INC = 1/-1) current line that starts with REGEXP and is not in `font-lock-comment-face'. (fn INC REGEXP) (defalias 'haskell-ds-move-to-start-regexp #[514 "y\300U\205\301!\203\302`\303\"\304=\205\202\207" [0 looking-at get-text-property face font-lock-comment-face] 5 (#$ . 2324)]) #@96 Like haskell-ds-move-to-start-regexp, but uses syntax-ppss to skip comments (fn INC REGEXP) (defalias 'haskell-ds-move-to-start-regexp-skipping-comments #[514 "\300`\262\301\"\210\302\303 8\203\211`U\203\300\207" [nil haskell-ds-move-to-start-regexp 4 syntax-ppss] 6 (#$ . 2672)]) #@282 Regexp matching start of a line of Bird-style literate code. Current value is "> " as we assume top-level declarations start at column 3. Must not contain the special "^" regexp as we may not use the regexp at the start of a regexp string. Note this is only for `imenu' support. (defvar literate-haskell-ds-line-prefix "> ?" (#$ . 2970)) #@47 The regexp that starts a Haskell declaration. (defvar haskell-ds-start-decl-re "\\(\\sw\\|(\\)" (#$ . 3316)) #@67 The regexp that starts a Bird-style literate Haskell declaration. (defvar literate-haskell-ds-start-decl-re (concat literate-haskell-ds-line-prefix haskell-ds-start-decl-re) (#$ . 3431)) #@52 Test if CHAR is a whitespace character. (fn CHAR) (defalias 'haskell-ds-whitespace-p #[257 "\211\300>\207" [(nil 9 10 32)] 3 (#$ . 3624)]) #@576 General function for moving to the start of a declaration, either forwards or backwards from point, with normal or with Bird-style literate scripts. If DIRECTION is t, then forward, else backward. If BIRD-LITERATE is t, then treat as Bird-style literate scripts, else normal scripts. Returns point if point is left at the start of a declaration, and nil otherwise, ie. because point is at the beginning or end of the buffer and no declaration starts there. If FIX is t, then point does not move if already at the start of a declaration. (fn DIRECTION BIRD-LITERATE FIX) (defalias 'haskell-ds-move-to-decl #[771 "\305\211\211\203 \202\f\306\203 \202\n\203\307\202\310\203(d\202)e\311 p\312\313#\216\314\f!\210`\315 \210\316!\205M\317 \320\234?\205M\307\224\211\203\205 \203[ \203e \204k \203kY\204\233 \203u \204 \204\205 \204\205V\204\233\211\203\225o\203\225\321\262 \266\202\235\322\310\"\210\266\203\263 \205/\323\324 P\305\321#\210`\202/\325 !\262 \204\313 \203\322\307\"\210\202\322\"\210`U\204\365\325 !\211\262 \203\365\230\203\365\262 \322\"\210\202\321 \204\316!\203 \325 !\230\203\316!\204o\203\322\307\"\210\316!n\203(\323\324 Pd\321#\210\211\205-`\262)\266\202)\207" [literate-haskell-ds-line-prefix literate-haskell-ds-start-decl-re haskell-ds-start-decl-re line-prefix haskell-ds-syntax-table nil "" 1 -1 syntax-table make-closure #[0 "r\301q\210\302\300!)\207" [V0 V1 set-syntax-table] 2] set-syntax-table beginning-of-line looking-at syntax-ppss 4 t haskell-ds-move-to-start-regexp-skipping-comments re-search-forward "\\=" haskell-ds-get-variable] 17 (#$ . 3771)]) (defalias 'haskell-ds-bird-p #[0 "\301\300!\205 \302=\207" [haskell-literate boundp bird] 2]) #@548 Move backward to the first character that starts a top-level declaration. A series of declarations concerning one variable is treated as one declaration by this function. So, if point is within a top-level declaration then move it to the start of that declaration. If point is already at the start of a top-level declaration, then move it to the start of the preceding declaration. Returns point if point is left at the start of a declaration, and nil otherwise, because point is at the beginning of the buffer and no declaration starts there. (defalias 'haskell-ds-backward-decl #[0 "\300\301\302 \301#\207" [haskell-ds-move-to-decl nil haskell-ds-bird-p] 4 (#$ . 5572) nil]) #@98 Test if the cursor is on whitespace or a comment. `PT' defaults to `(point)' (fn &optional PT) (defalias 'haskell-ds-comment-p #[256 "\300g!\204#\301\206\f`\302\"\211<\204\211C\262\303\304\305\306\"\"\262\205$\307\207" [haskell-ds-whitespace-p get-text-property face delq nil mapcar #[257 "\211\300>\207" [(font-lock-comment-face font-lock-doc-face font-lock-comment-delimiter-face)] 3 "\n\n(fn F)"] t] 7 (#$ . 6258)]) #@83 Tests if all characters from `point' to `end-of-line' pass `haskell-ds-comment-p' (defalias 'haskell-ds-line-commented-p #[0 "\300\211\203l\204\301 \204\302\262\302u\210\202\207" [t haskell-ds-comment-p nil] 2 (#$ . 6694)]) #@118 Move forward to the first character that starts a top-level declaration. As `haskell-ds-backward-decl' but forward. (defalias 'haskell-ds-forward-decl #[0 "`\300\211\211\211\301\300\302 \300#\210`\262\301\303\302 \300#\210`\262`X\205!l?\262eU\2052U\2052W\262\211\204<\203k\211\203K\212eb\210g)\304U\204O\203V\301\303\302 \300#\210\305y\210\306 \203ho\204h\305y\210\202Y\307y\210\266`\207" [nil haskell-ds-move-to-decl haskell-ds-bird-p t 10 -1 haskell-ds-line-commented-p 1] 9 (#$ . 6934) nil]) #@460 Find the name, position and type of the declaration at or after point. Return ((NAME . (START-POSITION . NAME-POSITION)) . TYPE) if one exists and nil otherwise. The start-position is at the start of the declaration, and the name-position is at the start of the name of the declaration. The name is a string, the positions are buffer positions and the type is one of the symbols "variable", "datatype", "class", "import" and "instance". (fn BIRD-LITERATE) (defalias 'haskell-ds-generic-find-next-decl #[257 "\302\211\211\211\211\303 p\304\305#\216\306!\210m\204\352\204\352\307\310 \310#\210`\262\311 \262\312 !\204L\313\314!\262\203\344\315\262\316\317!\310#\210\320\224\262\202\344\316\321\310#\203o\316\322\310#\210\312\323!\203\344\324\325!\262\325\224\262\326\262\202\344\316\327\310#\203\222\316\322\310#\210\312\323!\203\344\324\325!\262\325\224\262\330\262\202\344\312\331!\203\247\324\325!\262\325\224\262\332\262\202\344\316\333\310#\203\344\316\334\310#\210`\262\335`\316\336\310#\203\313\337\340!\210`\202\323b\210\341\302x\210`\"\262\342\343\"\203\341\302\262\344\262b\210\202\205\377\345\310\"\345\310\"BBB)\207" [haskell-ds-syntax-table haskell-ds-start-keywords-re nil syntax-table make-closure #[0 "r\301q\210\302\300!)\207" [V0 V1 set-syntax-table] 2] set-syntax-table haskell-ds-move-to-decl t line-end-position looking-at haskell-ds-get-variable "" variable re-search-forward regexp-quote 0 "\\=\\(data\\|newtype\\|type\\)\\>" "=>" "[ ]*\\(\\sw+\\)" match-string-no-properties 1 datatype "\\=class\\>" class "import[ ]+\\(?:safe[ ]+\\)?\\(?:qualified[ ]+\\)?\\(?:\"[^\"]*\"[ ]+\\)?\\(\\(?:\\sw\\|.\\)+\\)" import "\\=instance[ ]+" "=>[ ]+" buffer-substring-no-properties "\\" re-search-backward "\\s-where" " " string-match "^[ ]*$" instance copy-marker] 14 (#$ . 7461)]) #@181 Function for finding `imenu' declarations in Haskell mode. Finds all declarations (classes, variables, imports, instances and datatypes) in a Haskell file for the `imenu' package. (defalias 'haskell-ds-create-imenu-index #[0 "\301 \302\211\211\211\211\211\211eb\210`dW\203\215\303!\262\211\203\f\211@\211@A\211@A\211\304\267\266\202\f BB\266\203\262\n\266\202\fBB\266\203\262\266\202\f\fBB\266\203\262 \266\202\f\nBB\266\203\262 \266\202\f BB\266\203\262\266\202\f\266\202\f\203\232\305\306\307\"BC\262\203\251\310\306\307\"BB\262\203\270\311\306\307\"BB\262\203\310\312\306\307\"BB\262\203\352\203\337\313\306\307\"BB\262\202\352\314\306\307\"\"\262\207" [haskell-decl-scan-bindings-as-variables haskell-ds-bird-p nil haskell-ds-generic-find-next-decl #s(hash-table size 5 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (variable 46 datatype 64 class 82 import 100 instance 118)) "Datatypes" sort haskell-ds-imenu-label-cmp "Instances" "Imports" "Classes" "Variables" append] 18 (#$ . 9351)]) #@90 Predicate to compare labels in lists from `haskell-ds-create-imenu-index'. (fn EL1 EL2) (defalias 'haskell-ds-imenu-label-cmp #[514 "@@\231\207" [] 4 (#$ . 10462)]) #@38 Install `imenu' for Haskell scripts. (defalias 'haskell-ds-imenu #[0 "\302 \205 \303\304!\207" [imenu-create-index-function haskell-decl-scan-add-to-menubar haskell-ds-create-imenu-index imenu-add-to-menubar "Declarations"] 2 (#$ . 10636)]) #@52 Unconditionally activate `haskell-decl-scan-mode'. (defalias 'turn-on-haskell-decl-scan #[0 "\300 \207" [haskell-decl-scan-mode] 1 (#$ . 10885) nil]) (make-obsolete 'turn-on-haskell-decl-scan 'haskell-decl-scan-mode "2015-07-23") #@113 Non-nil if Haskell-Decl-Scan mode is enabled. Use the command `haskell-decl-scan-mode' to change this variable. (defvar haskell-decl-scan-mode nil (#$ . 11122)) (make-variable-buffer-local 'haskell-decl-scan-mode) #@1527 Toggle Haskell declaration scanning minor mode on or off. With a prefix argument ARG, enable minor mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'. See also info node `(haskell-mode)haskell-decl-scan-mode' for more details about this minor mode. Top-level declarations are scanned and listed in the menu item "Declarations" (if enabled via option `haskell-decl-scan-add-to-menubar'). Selecting an item from this menu will take point to the start of the declaration. \[beginning-of-defun] and \[end-of-defun] move forward and backward to the start of a declaration. This may link with `haskell-doc-mode'. For non-literate and LaTeX-style literate scripts, we assume the common convention that top-level declarations start at the first column. For Bird-style literate scripts, we assume the common convention that top-level declarations start at the third column, ie. after "> ". Anything in `font-lock-comment-face' is not considered for a declaration. Therefore, using Haskell font locking with comments coloured in `font-lock-comment-face' improves declaration scanning. Literate Haskell scripts are supported: If the value of `haskell-literate' (set automatically by `haskell-literate-mode') is `bird', a Bird-style literate script is assumed. If it is nil or `tex', a non-literate or LaTeX-style literate script is assumed, respectively. Invokes `haskell-decl-scan-mode-hook' on activation. (fn &optional ARG) (defalias 'haskell-decl-scan-mode #[256 "\305 \306=\203 ?\202\247\203\307W\203\310\202\311\312\301!\2031\313\300 \"\2031\300 B\314\303!\210\314\304!\210\314\315!\210\204J\n\203J\316\317\310\"\210\203]\320\303!\210\321\320\304!\210\322\323 \210\324\325\203g\326\202h\327\"\210\330\331!\203\212\305 \203|\211\305 \232\203\212\332\333\203\206\334\202\207\335\336#\210\210\337 \210\207" [haskell-decl-scan-mode local-minor-modes haskell-decl-scan-add-to-menubar beginning-of-defun-function end-of-defun-function current-message toggle 1 nil t boundp delq kill-local-variable imenu-create-index-function local-set-key [menu-bar index] make-local-variable haskell-ds-backward-decl haskell-ds-forward-decl haskell-ds-imenu run-hooks haskell-decl-scan-mode-hook haskell-decl-scan-mode-on-hook haskell-decl-scan-mode-off-hook called-interactively-p any message "Haskell-Decl-Scan mode %sabled%s" "en" "dis" " in current buffer" force-mode-line-update] 6 (#$ . 11344) (byte-code "\203\n\301!\202 \302C\207" [current-prefix-arg prefix-numeric-value toggle] 2)]) (defvar haskell-decl-scan-mode-hook nil) (byte-code "\301\302N\204\f\303\301\302\304#\210\303\301\305\306#\210\303\301\307\310C#\210\311\312\310\313\300!\205#\310\211%\210\314\315!\207" [haskell-decl-scan-mode-map haskell-decl-scan-mode-hook variable-documentation put "Hook run after entering or leaving `haskell-decl-scan-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" custom-type hook standard-value nil add-minor-mode haskell-decl-scan-mode boundp provide haskell-decl-scan] 6)