;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\301\302!\210\303\304!\204.\305\304\306\"\210\307\310\"\210\311\312\313\"\262\211\203-\211@\314\304\"\210A\266\202\202\210\313\207" [unicode-category-table require rx category-docstring 80 define-category "Haskell symbol constituent characters" map-char-table #[514 ":\203\f@\300V\204\247\205!\300V\205!\211\301>\205!\302\303\"\207" [128 (Pc Pd Po Sm Sc Sk So) modify-category-entry 80] 5 "\n\n(fn KEY VAL)"] "!#$%&*+./<=>?@^|~\\-:" append nil modify-category-entry] 5) #@309 Regexp matching a valid Haskell module identifier. Note that GHC accepts Unicode category UppercaseLetter as a first character. Following letters are from Unicode categories UppercaseLetter, LowercaseLetter, OtherLetter, TitlecaseLetter, ModifierLetter, DecimalNumber, OtherNumber, backslash or underscore. (defconst haskell-lexeme-modid "[[:upper:]][[:alnum:]'_]*" (#$ . 590)) #@188 Regexp matching a valid Haskell identifier. GHC accepts a string starting with any alphabetic character or underscore followed by any alphanumeric character or underscore or apostrophe. (defconst haskell-lexeme-id "[[:alpha:]_][[:alnum:]'_]*" (#$ . 976)) #@202 Regexp matching a valid Haskell variable or constructor symbol. GHC accepts a string of chars from the set [:!#$%&*+./<=>?@^|~\-] or Unicode category Symbol for chars with codes larger than 128 only. (defconst haskell-lexeme-sym "\\cP+" (#$ . 1239)) #@118 Regexp matching first character of a qualified or unqualified identifier or symbol. Useful for `re-search-forward'. (defconst haskell-lexeme-idsym-first-char "\\(?:[[:alpha:]_]\\|\\cP\\)" (#$ . 1497)) #@187 Regexp matching a valid Haskell module prefix, potentially empty. Module path prefix is separated by dots and finishes with a dot. For path component syntax see `haskell-lexeme-modid'. (defconst haskell-lexeme-modid-opt-prefix (concat "\\(?:" haskell-lexeme-modid "\\.\\)*") (#$ . 1706)) #@115 Regexp matching a valid qualified identifier or symbol. Note that (match-string 1) returns the unqualified part. (defconst haskell-lexeme-qid-or-qsym (byte-code "\303\304\305D\306\307\305 D\305\nDEDE!\207" [haskell-lexeme-modid-opt-prefix haskell-lexeme-id haskell-lexeme-sym rx-to-string : regexp group |] 8) (#$ . 2002)) #@461 Non-nil when point is just in front of an optionally qualified identifier or symbol. Using this function is more efficient than matching against the regexp `haskell-lexeme-qid-or-qsym'. Returns: 'qid - if matched a qualified id: 'Data.Map' or 'Map' 'qsym - if matched a qualified id: 'Monad.>>=' or '>>=' 'qprefix - if matched only modid prefix: 'Data.' After successful 'qid or 'qsym match (match-string 1) will return the unqualified part (if any). (defalias 'haskell-lexeme-looking-at-qidsym #[0 "`\303 \212\304\305P!\203\306\225b\210\202\304 !\2037\306\224\306\225\211b\210\304\307!\203*\306\225\262\310F!\266\311\202c\304\n!\203L\310\306\225\306\224\306\225F!\210\312\202c`\232\203Z\310!\210\313\202c\310`\313\211F!\210\314)\207" [haskell-lexeme-modid haskell-lexeme-id haskell-lexeme-sym match-data looking-at "\\." 0 "#+" set-match-data qid qsym nil qprefix] 9 (#$ . 2334)]) #@297 Non-nil when point is just in front of an identifier quoted with backticks. When match is successful, match-data will contain: (match-text 1) - opening backtick (match-text 2) - whole qualified identifier (match-text 3) - unqualified part of identifier (match-text 4) - closing backtick (defalias 'haskell-lexeme-looking-at-backtick #[0 "\300 \301\211\211\211\211\211\212\302\303!\203`\304\224\262\304\225b\210\305\306 !\210\307 \203`\304\224\262\310\224\262\310\225\262\304\225b\210\305\306 !\210\302\303!\203`\304\224\262\311\312\313T\n\211T\n   \211T\257\n\"!\210\314\262)\211\204j\311!\210\207" [match-data nil looking-at "`" 0 forward-comment buffer-size haskell-lexeme-looking-at-qidsym 1 set-match-data mapcar #[257 "\300 \301\223\207" [make-marker nil] 4 "\n\n(fn P)"] t] 20 (#$ . 3254)]) #@105 Regexp matching a valid qualified identifier. Note that (match-string 1) returns the unqualified part. (defconst haskell-lexeme-qid (byte-code "\302\303\304\305D\306\305 DDF!\207" [haskell-lexeme-modid-opt-prefix haskell-lexeme-id rx-to-string : (regexp "'*") regexp group] 7) (#$ . 4091)) #@101 Regexp matching a valid qualified symbol. Note that (match-string 1) returns the unqualified part. (defconst haskell-lexeme-qsym (byte-code "\302\303\304\305D\306\305 DDF!\207" [haskell-lexeme-modid-opt-prefix haskell-lexeme-id rx-to-string : (regexp "'*") regexp group] 7) (#$ . 4390)) #@128 Regexp matching a floating point, decimal, octal or hexadecimal number. Note that negative sign char is not part of a number. (defconst haskell-lexeme-number "\\(?:[0-9]+\\.[0-9]+\\)\\(?:[eE][-+]?[0-9]+\\)?\\|[0-9]+[eE][-+]?[0-9]+\\|0[xX][0-9a-fA-F]+\\|0[oO][0-7]+\\|[0-9]+" (#$ . 4686)) #@165 Regexp matching an inside of a character literal. Note that `haskell-lexeme-char-literal-inside' matches strictly only escape sequences defined in Haskell Report. (defconst haskell-lexeme-char-literal-inside "[^\n'\\]\\|\\\\\\(?:a\\|b\\|f\\|n\\|r\\|t\\|v\\|\\\\\\|\"\\|'\\|NUL\\|SOH\\|STX\\|ETX\\|EOT\\|ENQ\\|ACK\\|BEL\\|BS\\|HT\\|LF\\|VT\\|FF\\|CR\\|SO\\|SI\\|DLE\\|DC1\\|DC2\\|DC3\\|DC4\\|NAK\\|SYN\\|ETB\\|CAN\\|EM\\|SUB\\|ESC\\|FS\\|GS\\|RS\\|US\\|SP\\|DEL\\|[0-9]+\\|x\\(?:[0-9a-fA-F]+\\)\\|o\\(?:[0-7]+\\)\\|\\^[]A-Z@^_\\[]\\)" (#$ . 4982)) #@506 Regexp matching a character literal lookalike. Note that `haskell-lexeme--char-literal-rx' matches more than Haskell Report specifies because we want to support also code under edit. Character literals end with a quote or a newline or end of buffer. Regexp has subgroup expressions: (match-text 1) matches the opening quote. (match-text 2) matches the inside of the character literal. (match-text 3) matches the closing quote or an empty string at the end of line or the end buffer. (defconst haskell-lexeme--char-literal-rx (rx-to-string '(: (group "'") (| (: (group (regexp "[[:alpha:]_:([]")) (group "'")) (: (group (| (regexp "\\\\[^\n][^'\n]*") (regexp "[^[:alpha:]_:(['\n][^'\n]*"))) (| (group "'") "\n" (regexp "\\'")))))) (#$ . 5537)) #@488 Non-nil when point is at a char literal lookalike. Note that this function matches more than Haskell Report specifies because we want to support also code under edit. Char literals end with a quote or an unescaped newline or end of buffer. After successful match: (match-text 1) matches the opening quote. (match-text 2) matches the inside of the char literla. (match-text 3) matches the closing quote, or a closing newline or is nil when at the end of the buffer. (defalias 'haskell-lexeme-looking-at-char-literal #[0 "\301!\2050\302\303\224\303\225\304\224\304\225\305\224\206\306\224\305\225\206\306\225\307\224\206$\310\224\307\225\206+\310\225\257!\210\311\207" [haskell-lexeme--char-literal-rx looking-at set-match-data 0 1 2 4 3 5 t] 9 (#$ . 6309)]) #@229 Regexp matching an item that is a single character or a single escape sequence inside of a string literal. Note that `haskell-lexeme-string-literal-inside-item' matches strictly only escape sequences defined in Haskell Report. (defconst haskell-lexeme-string-literal-inside-item "[^\n\"\\]\\|\\\\\\(?:a\\|b\\|f\\|n\\|r\\|t\\|v\\|\\\\\\|\"\\|'\\|&\\|NUL\\|SOH\\|STX\\|ETX\\|EOT\\|ENQ\\|ACK\\|BEL\\|BS\\|HT\\|LF\\|VT\\|FF\\|CR\\|SO\\|SI\\|DLE\\|DC1\\|DC2\\|DC3\\|DC4\\|NAK\\|SYN\\|ETB\\|CAN\\|EM\\|SUB\\|ESC\\|FS\\|GS\\|RS\\|US\\|SP\\|DEL\\|[0-9]+\\|x\\(?:[0-9a-fA-F]+\\)\\|o\\(?:[0-7]+\\)\\|\\^[]A-Z@^_\\[]\\|[ \n \f]*\\\\\\)" (#$ . 7104)) #@514 Regexp matching a string literal lookalike. Note that `haskell-lexeme-string-literal' matches more than Haskell Report specifies because we want to support also code under edit. String literals end with double quote or unescaped newline or end of buffer. Regexp has subgroup expressions: (match-text 1) matches the opening double quote. (match-text 2) matches the inside of the string. (match-text 3) matches the closing double quote or an empty string at the end of line or the end buffer. (defconst haskell-lexeme-string-literal "\\(\"\\)\\(\\(?:\\\\[ \n \f]*\\\\\\|\\\\[ \n \f]+\\|\\\\[^ \n \f]\\|[^\"\n\\]*\\)*\\)\\(\"\\|$\\|\\\\?\\'\\)" (#$ . 7753)) #@494 Non-nil when point is at a string literal lookalike. Note that this function matches more than Haskell Report specifies because we want to support also code under edit. String literals end with double quote or unescaped newline or end of buffer. After successful match: (match-text 1) matches the opening doublequote. (match-text 2) matches the inside of the string. (match-text 3) matches the closing quote, or a closing newline or is nil when at the end of the buffer. (defalias 'haskell-lexeme-looking-at-string-literal #[0 "\300\301!\205\217\212`\302\225b\210\303\211\204w\304\305\303\306#\203w\307\302!\310\232\2035\300\311!\203.\302\225b\210\202 `Tb\210\202 \307\302!\301\232\203W\312\302\225\211TT\302\224\302\224\302\225\257!\210\313\262\202 \307\302!\314\232\203 \312\302\224\211TT\302\224\303\211\257!\210\313\262\202 \211\204\213\312`\211TT`\303\211\257!\210\266)\313\207" [looking-at "\"" 0 nil re-search-forward "[\"\n\\]" goto-eob match-string "\\" "[ \n \f]+\\\\?" set-match-data t "\n"] 11 (#$ . 8443)]) #@670 Non-nil when point is just in front of Template Haskell quaisquote literal. Quasi quotes start with '[xxx|' or '[$xxx|' sequence and end with '|]'. The 'xxx' is a quoter name. There is no escaping mechanism provided for the ending sequence. Regexp has subgroup expressions: (match-text 1) matches the quoter name (without $ sign if present). (match-text 2) matches the opening vertical bar. (match-text 3) matches the inside of the quoted string. (match-text 4) matches the closing vertical bar or nil if at the end of the buffer. Note that this function excludes 'e', 't', 'd', 'p' as quoter names according to Template Haskell specification. (defalias 'haskell-lexeme-looking-at-quasi-quote-literal #[0 "\302 \303\304\305\306\307\310D\311\310 DD\312BBBBB!!\203\216\313\314\224f!\315=\203\216\316\314!\317\235\204\216\212\320\225b\210\302 \321\322\323\324#\205=\302 \211\203l\325@A@\3268\3278\3308\3318\331 8@ @\n@T\257\n!\266\202\213\325@d\3268\3278\3308\3318\331 8d\323\211\257\n!\266)\324\207\325!\210\323\207" [haskell-lexeme-modid-opt-prefix haskell-lexeme-id match-data looking-at rx-to-string : "[" (optional "$") regexp group ((group "|")) haskell-lexeme-classify-by-first-char 1 varid match-string ("e" "t" "d" "p") 0 re-search-forward "|]" nil t set-match-data 2 3 4 5] 14 (#$ . 9524)]) #@113 Classify token by CHAR. CHAR is a chararacter that is assumed to be the first character of a token. (fn CHAR) (defalias 'haskell-lexeme-classify-by-first-char #[257 "\300\206\301\302\"\303>\204\304V\203\211\305>\203\306\207\307\267\202(\310\207\311\207\312\207\211\313>\2030\314\207\315=\204<\211\316>\203>\317\207\320Y\203L\321X\203L\322\207\323>\205S\324\207" [get-char-code-property 32 general-category (33 35 36 37 38 42 43 46 47 60 61 62 63 64 94 124 126 92 45) 127 (Pc Pd Po Sm Sc Sk So) varsym #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (58 34 39 36 34 38)) consym char string (Lu Lt) conid 95 (Ll Lo) varid 48 57 number (93 91 40 41 123 125 96 44 59) special] 4 (#$ . 10887)]) #@1030 Like `looking-at' but understands Haskell lexemes. Moves point forward over whitespace. Returns a symbol describing type of Haskell token recognized. Use `match-string', `match-beginning' and `match-end' with argument 0 to query match result. Possible results are: - 'special: for chars [](){}`,; - 'comment: for single line comments - 'nested-comment: for multiline comments - 'qsymid: for qualified identifiers or symbols - 'string: for strings literals - 'char: for char literals - 'number: for decimal, float, hexadecimal and octal number literals - 'template-haskell-quote: for a string of apostrophes for template haskell - 'template-haskell-quasi-quote: for a string of apostrophes for template haskell Note that for qualified symbols (match-string 1) returns the unqualified identifier or symbol. Further qualification for symbol or identifier can be done with: (haskell-lexeme-classify-by-first-char (char-after (match-beginning 1))) See `haskell-lexeme-classify-by-first-char' for details. (fn &rest FLAGS) (defalias 'haskell-lexeme-looking-at-token #[128 "\302\303!\304V\204\305>\204\306\307w\304V\204\307\310 \311`\312\"\313\232\2033\314\315 \316 \307\223D!\210\317\202\277\320\306!\203=\305\202\277\320\321!\203T\212\322\323!\210\314\310 D!\210)\324\202\277\325 \203]\326\202\277\327 \203f\330\202\277\320\331!\203y\332 \203u\333\202\277\334\202\277\335 \203\244\336 \337\340\"\216\341\342\343\304!\")\262\203\240\314\315 \316 \307\223D!\210\344\202\277\345\202\277\320 !\203\256\346\202\277\320\347!\203\270\350\202\277\320\351!\205\277\352)\207" [case-fold-search haskell-lexeme-number skip-syntax-forward "-" 0 newline "\n" nil point-marker get-char-property syntax-table (11) set-match-data make-marker line-end-position literate-comment looking-at "{-" forward-comment 1 nested-comment haskell-lexeme-looking-at-char-literal char haskell-lexeme-looking-at-string-literal string "[][(){}`,;]" haskell-lexeme-looking-at-quasi-quote-literal template-haskell-quasi-quote special haskell-lexeme-looking-at-qidsym match-data make-closure #[0 "\301\300\302\"\207" [V0 set-match-data evaporate] 3] string-match "\\`---*\\'" match-string-no-properties comment qsymid number "'+" template-haskell-quote "." illegal] 8 (#$ . 11647)]) (provide 'haskell-lexeme)