;ELC
;;; Compiled by haakon@haakon-laptop on Thu Aug 22 10:20:06 2013
;;; from file /home/haakon/.emacs.d/elpa/haskell-mode-13.7/haskell-decl-scan.el
;;; in Emacs version 24.2.1
;;; with all optimizations.

;;; This file contains utf-8 non-ASCII characters,
;;; and so cannot be loaded into Emacs 22 or earlier.
(and (boundp 'emacs-version)
     (< (aref emacs-version (1- (length emacs-version))) ?A)
     (string-lessp emacs-version "23")
     (error "`%s' was compiled for Emacs 23 or later" load-file-name))

;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\210\300\302!\210\300\303!\210\304\305\306\307!\203\307\202\310\"\207" [require haskell-mode syntax cl defalias haskell-ds-match-string fboundp match-string-no-properties #[(num) "\301\302\303!\"\207" [num format "%s" match-string] 4 "As `match-string' except that the string is stripped of properties."]] 4)
#@40 Keywords that may start a declaration.
(defvar haskell-ds-start-keywords-re "\\(\\<class\\|data\\|i\\(mport\\|n\\(fix\\(\\|[lr]\\)\\|stance\\)\\)\\|module\\|primitive\\|type\\|newtype\\)\\>" (#$ . 877))
#@53 Syntax table used for Haskell declaration scanning.
(defvar haskell-ds-syntax-table (byte-code "\302!\303\304\305	#\210\303\306\305	#\210\303\307\310	#\210	)\207" [haskell-mode-syntax-table table copy-syntax-table modify-syntax-entry 39 "w" 95 92 "_"] 4) (#$ . 1086))
#@274 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.
(defalias 'haskell-ds-get-variable #[(prefix) "\212\306 p\307\216\310\n!\210\311!\203\312\225b\210\311\f!?\205i\311\313!\203)\314\315!\206i\311\316f\317=\2038\320 \210\321\2029\322!\203`\314\323!\211\324\235\203M\314\315!\202\\
\312H\325=\203[\314\326!\202\\
)\206i\311\327!\205i\314\312!,\207" [#1=#:buffer #2=#:table haskell-ds-syntax-table prefix haskell-ds-start-keywords-re match2 syntax-table ((byte-code "rq\210\302	!\210)\302\207" [#1# #2# set-syntax-table] 2)) set-syntax-table looking-at 0 "(\\(\\s_+\\))" haskell-ds-match-string 1 nil 40 forward-sexp "\\(\\'\\)?\\s-*\\(\\s_+\\|`\\(\\sw+\\)`\\)" "\\(\\sw+\\)?\\s-*\\(\\s_+\\|`\\(\\sw+\\)`\\)" 2 ("::" "âˆ·" "=" "|") 96 3 "\\sw+"] 4 (#$ . 1363)])
#@140 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'.
(defalias 'haskell-ds-move-to-start-regexp #[(inc regexp) "y\302U\205\303	!\203\304`\305\"\306=\205\202\207" [inc regexp 0 looking-at get-text-property face font-lock-comment-face] 3 (#$ . 2369)])
#@79 Like haskell-ds-move-to-start-regexp, but uses syntax-ppss to
  skip comments
(defalias 'haskell-ds-move-to-start-regexp-skipping-comments #[(inc regexp) "\303`\304	\n\"\210\305\306 8\203`U\203)\303\207" [p inc regexp nil haskell-ds-move-to-start-regexp 4 syntax-ppss] 3 (#$ . 2720)])
#@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 "> ?" (#$ . 3019))
#@47 The regexp that starts a Haskell declaration.
(defvar haskell-ds-start-decl-re "\\(\\sw\\|(\\)" (#$ . 3365))
#@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) (#$ . 3480))
#@542 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.
(defalias 'haskell-ds-move-to-decl #[(direction bird-literate fix) "\306\211\211\203	\202\f\307\203\n\202\f\203\310\202\311\f\203&d\202'e\312 p\313\216\314!\210`\315 \210\316!\205Y\317`\320\"\321=?\205Y\310\224 ! \203\226\f\203k\"\203t\f\204|\"\203|! Y\204\253\f\203\205\"\204\216\f\204\226\"\204\226! V\204\253 \203\245o\203\245\322\202\253\323\311\"\210*\203\302\f\205F\324\325P\306\322#\210`\202F\326!\211\204\331\f\203,\323\310\"\210\202,\323\"\210`
U\204\326!\211\203\230\203\323\"\210\202\340\f\204,\316!\203\326!\230\203&\316!\204,o\203,\323\310\"\210\316!#n\203?\324\325Pd\322#\210#\205E`).\n\207" [bird-literate literate-haskell-ds-line-prefix literate-haskell-ds-start-decl-re haskell-ds-start-decl-re direction bound nil "" 1 -1 syntax-table ((byte-code "rq\210\302	!\210)\302\207" [#1=#:buffer #2=#:table set-syntax-table] 2)) set-syntax-table beginning-of-line looking-at get-text-property face font-lock-comment-face t haskell-ds-move-to-start-regexp-skipping-comments re-search-forward "\\=" haskell-ds-get-variable increment start-decl-re line-prefix abyss newname name #1# #2# haskell-ds-syntax-table start here fix at-start-decl] 8 (#$ . 3674)])
(defalias 'haskell-ds-bird-p #[nil "\301\300!\205	\302=\207" [haskell-literate boundp bird] 2])
#@552 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, ie. because
point is at the beginning of the buffer and no declaration starts
there.
(defalias 'haskell-ds-backward-decl #[nil "\300\301\302 \301#\207" [haskell-ds-move-to-decl nil haskell-ds-bird-p] 4 (#$ . 5621) nil])
#@44 As `haskell-ds-backward-decl' but forward.
(defalias 'haskell-ds-forward-decl #[nil "\300\301\302 \303#\207" [haskell-ds-move-to-decl t haskell-ds-bird-p nil] 4 (#$ . 6313) nil])
#@440 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".
(defalias 'haskell-ds-generic-find-next-decl #[(bird-literate) "\306\211\211\211\211\307 p+\310\216\311,!\210m\204\333\f\204\333\312\313-\313#\210`\314 \315.!\204J\316\317!\211\203\325\320\321\322\f!\313#\210\323\224\202\325\321\324\313#\203j\321\325\313#\210\315\326!\203\325\327\330!\330\224\331\202\325\321\332\313#\203\212\321\325\313#\210\315\326!\203\325\327\330!\330\224\333\202\325\315\334!\203\234\327\335!\335\224\336\202\325\321\337\313#\203\325\321\340\313#\210`\341\342`\321\343\313#\203\277\344\345!\210`\202\307b\210\346\306x\210`{\"\347\350\f\"\203\323\306\351b\210\202\f\205\354\f\352	\313\"\352\n\313\"BBB.\207" [end start name-pos type name #1=#:buffer nil syntax-table ((byte-code "rq\210\302	!\210)\302\207" [#1# #2=#:table 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+\\)" haskell-ds-match-string 1 datatype "\\=class\\>" class "import[ 	]+\\(qualified[ 	]+\\)?\\(\\(?:\\sw\\|.\\)+\\)" 2 import "\\=instance[ 	]+" "=>[ 	]+" format "%s" "\\<where\\>" re-search-backward "\\s-where" " 	" string-match "^[ 	]*$" instance copy-marker #2# haskell-ds-syntax-table bird-literate haskell-ds-start-keywords-re] 8 (#$ . 6499)])
#@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 #[nil "\306 \307\211\307\211\307\211\310 \311\312 \313\245]\307eb\210`dW\203k\314\315`eZ\245#\210\316!\211\203\"@\211@A\211@ A\211!\317\236A\211\" B\"JBL\210.\202\"\314\320\"\210\203\200\321\322\323\"B	B
\203\215\324\322
\323\"B	B\f\203\232\325\322\f\323\"B	B\203\247\326\322\323\"B	B\n\203\264\327\322\n\323\"B	B\314\330\"\210	.\n\207" [bird-literate index-alist index-class-alist index-var-alist index-imp-alist index-inst-alist haskell-ds-bird-p nil buffer-name 1 buffer-size 100 message "Scanning declarations in %s... (%3d%%)" haskell-ds-generic-find-next-decl ((variable . index-var-alist) (datatype . index-type-alist) (class . index-class-alist) (import . index-imp-alist) (instance . index-inst-alist)) "Sorting declarations in %s..." "Datatypes" sort haskell-ds-imenu-label-cmp "Instances" "Imports" "Variables" "Classes" "Sorting declarations in %s...done" index-type-alist bufname divisor-of-progress result name-posns name posns start-pos type sym] 6 (#$ . 8319)])
#@76 Predicate to compare labels in lists from `haskell-ds-create-imenu-index'.
(defalias 'haskell-ds-imenu-label-cmp #[(el1 el2) "@	@\231\207" [el1 el2] 2 (#$ . 9588)])
#@38 Install `imenu' for Haskell scripts.
(defalias 'haskell-ds-imenu #[nil "\301\302\303!\205\303\304!\207" [imenu-create-index-function haskell-ds-create-imenu-index fboundp imenu-add-to-menubar "Declarations"] 2 (#$ . 9760)])
#@70 Non-literate Haskell version of `haskell-ds-generic-func-menu-next'.
(defalias 'haskell-ds-func-menu-next #[(buffer) "\301\302 \"\207" [buffer haskell-ds-generic-func-menu-next haskell-ds-bird-p] 3 (#$ . 9993)])
#@44 Return `(name . pos)' of next declaration.
(defalias 'haskell-ds-generic-func-menu-next #[(bird-literate buffer) "q\210\306	!\211\205\n@\211@A\211A\f,B)\207" [buffer bird-literate result name-posns name posns haskell-ds-generic-find-next-decl name-pos] 3 (#$ . 10212)])
#@54 Regexp to match the start of a possible declaration.
(defvar haskell-ds-func-menu-regexp (concat "^" haskell-ds-start-decl-re) (#$ . 10500))
#@71 As `haskell-ds-func-menu-regexp' but for Bird-style literate scripts.
(defvar literate-haskell-ds-func-menu-regexp (concat "^" literate-haskell-ds-start-decl-re) (#$ . 10647))
#@72 Use `func-menu' to establish declaration scanning for Haskell scripts.
(defalias 'haskell-ds-func-menu #[nil "\303\304!\210\305\300!\210\306\305\301!\210\307 \203\310\202\311\305\302!\210\312\313 \210\314\315\316\"\210\314\317\320\"\210\314\321\322\"\207" [fume-menubar-menu-name fume-function-name-regexp-alist fume-find-function-name-method-alist require func-menu make-local-variable "Declarations" haskell-ds-bird-p ((haskell-mode . literate-haskell-ds-func-menu-regexp)) ((haskell-mode . haskell-ds-func-menu-regexp)) ((haskell-mode . haskell-ds-func-menu-next)) fume-add-menubar-entry local-set-key "l" fume-list-functions "g" fume-prompt-function-goto [(meta button1)] fume-mouse-function-goto] 3 (#$ . 10829)])
(defalias 'turn-on-haskell-decl-scan #[nil "\300\301!\207" [haskell-decl-scan-mode 1] 2 nil nil])
(defvar haskell-decl-scan-mode nil)
(make-variable-buffer-local 'haskell-decl-scan-mode)
#@1684 Minor mode for declaration scanning for Haskell mode.
Top-level declarations are scanned and listed in the menu item "Declarations".
Selecting an item from this menu will take point to the start of the
declaration.

\[haskell-ds-forward-decl] and \[haskell-ds-backward-decl] move forward and backward to the start of a declaration.

Under XEmacs, the following keys are also defined:

\[fume-list-functions] lists the declarations of the current buffer,
\[fume-prompt-function-goto] prompts for a declaration to move to, and
\[fume-mouse-function-goto] moves to the declaration whose name is at point.

This may link with `haskell-doc' (only for Emacs currently).

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.

To turn on declaration scanning for all Haskell buffers, add this to
.emacs:

  (add-hook 'haskell-mode-hook 'turn-on-haskell-decl-scan)

To turn declaration scanning on for the current buffer, call
`turn-on-haskell-decl-scan'.

Literate Haskell scripts are supported: If the value of
`haskell-literate' (automatically set by the Haskell mode of
Moss&Thorn) 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'.
(defalias 'haskell-decl-scan-mode #[(&optional arg) "\303\301!\203$\203\304\301!\210\305\304\302!\210\306\2026\307\301!\210\307\302!\210\2026\310\311\205+\306\"\210\310\312\2054\305\"\210\203L\313\314!\203F\315 \210\202Q\316 \210\202Q\310\317\320\"\210\321\322!\207" [haskell-decl-scan-mode beginning-of-defun-function end-of-defun-function boundp make-local-variable haskell-ds-backward-decl haskell-ds-forward-decl kill-local-variable local-set-key "\205" "\201" fboundp imenu haskell-ds-imenu haskell-ds-func-menu [menu-bar index] nil run-hooks haskell-decl-scan-mode-hook] 3 (#$ . 11752) nil])
(provide 'haskell-decl-scan)
