;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. #@55 Types of tokens that represent leaf nodes in the AST. (defvar parseclj-lex--leaf-tokens '(:whitespace :comment :number :nil :true :false :symbol :keyword :string :regex :character) (#$ . 87)) #@57 Types of tokens that mark the end of a non-atomic form. (defvar parseclj-lex--closing-tokens '(:rparen :rbracket :rbrace) (#$ . 285)) #@43 Tokens that modify the form that follows. (defvar parseclj-lex--prefix-tokens '(:quote :backquote :unquote :unquote-splice :discard :tag :reader-conditional :reader-conditional-splice :var :deref :map-prefix :eval) (#$ . 425)) #@47 Tokens that modify the two forms that follow. (defvar parseclj-lex--prefix-2-tokens '(:metadata) (#$ . 658)) #@312 Create a lexer token with the specified attributes. Tokens at a mimimum have these attributes - TYPE: the type of token, like :whitespace or :lparen - FORM: the source form, a string - POS: the position in the input, starts from 1 (like point) Other ATTRIBUTES can be given as a flat list of key-value pairs. (defalias 'parseclj-lex-token #[(type form pos &rest attributes) "\304\305\306\307 \310\n &\207" [type form pos attributes apply a-list :token-type :form :pos] 9 (#$ . 774)]) #@169 Create a lexer error token starting at POS. ERROR-TYPE is an optional keyword to attach to the created token, as the means for providing more information on the error. (defalias 'parseclj-lex-error-token #[(pos &optional error-type) "\302\303\304\305`\" \205\306 D%\207" [pos error-type apply parseclj-lex-token :lex-error buffer-substring-no-properties :error-type] 7 (#$ . 1269)]) #@109 Is the given TOKEN a parseclj-lex TOKEN. A token is an association list with :token-type as its first key. (defalias 'parseclj-lex-token-p #[(token) ":\205@:\205@@\301=\207" [token :token-type] 2 (#$ . 1663)]) #@24 Get the type of TOKEN. (defalias 'parseclj-lex-token-type #[(token) ":\205 \301\236A\207" [token :token-type] 2 (#$ . 1887)]) #@24 Get the form of TOKEN. (defalias 'parseclj-lex-token-form #[(token) ":\205 \301\236A\207" [token :form] 2 (#$ . 2022)]) #@49 Return t if the given AST TOKEN is a leaf node. (defalias 'parseclj-lex-leaf-token-p #[(token) "\302! \235\207" [token parseclj-lex--leaf-tokens parseclj-lex-token-type] 2 (#$ . 2151)]) #@53 Return t if the given ast TOKEN is a closing token. (defalias 'parseclj-lex-closing-token-p #[(token) "\302! \235\207" [token parseclj-lex--closing-tokens parseclj-lex-token-type] 2 (#$ . 2344)]) #@56 Return t if the TOKEN represents a lexing error token. (defalias 'parseclj-lex-error-p #[(token) "\301!\302=\207" [token parseclj-lex-token-type :lex-error] 2 (#$ . 2547)]) #@343 Parse an EDN string S into a regular string. S goes through three transformations: - Escaped characters in S are transformed into Elisp escaped characters. - Unicode escaped characters are decoded into its corresponding unicode character counterpart. - Octal escaped characters are decoded into its corresponding character counterpart. (defalias 'parseclj-lex--string-value #[(s) "\301\302\303\301\304\305\301\306\307\310\311O###\207" [s replace-regexp-in-string "\\\\o[0-8]\\{3\\}" #[(x) "\301\302\303\304\305O\306\"\"\207" [x make-string 1 string-to-number 2 nil 8] 6] "\\\\u[0-9a-fA-F]\\{4\\}" #[(x) "\301\302\303\304\305O\306\"\"\207" [x make-string 1 string-to-number 2 nil 16] 6] "\\\\[tbnrf'\"\\]" #[(x) "\302\234\211\303\267\202\"\304\202&\305\202&\306\202&\307\202&\310\202&\311\202&\302\312O)\207" [x #1=#:temp 1 #s(hash-table size 6 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (116 10 102 14 34 18 114 22 110 26 92 30)) " " "\f" "\"" " " "\n" "\\\\" nil] 4] 1 -1] 12 (#$ . 2728)]) #@56 Parse an EDN character C into an Emacs Lisp character. (defalias 'parseclj-lex--character-value #[(c) "\302\234\303\267\202\304\2025\305\2025\306\2025\307\2025 \310\267\2024\311\312\313O\314\"\2025\311\312\313O\315\"\2025 )\207" [c first-char 1 #s(hash-table size 4 test equal rehash-size 1.5 rehash-threshold 0.8125 purecopy t data ("\\newline" 10 "\\return" 14 "\\space" 18 "\\tab" 22)) 10 13 32 9 #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (117 32 111 42)) string-to-number 2 nil 16 8] 4 (#$ . 3765)]) #@52 Parse the given leaf TOKEN to an Emacs Lisp value. (defalias 'parseclj-lex--leaf-token-value #[(token) "\302!\211\303\267\202C\304\305\306\"!\202D\307\202D\310\202D\307\202D\311\305\306\"!\202D\311\305\306\"!\202D\312\305\306\"!\202D\313\305\306\"!\202D\307)\207" [token #1=#:temp parseclj-lex-token-type #s(hash-table size 8 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (:number 10 :nil 19 :true 23 :false 27 :symbol 31 :keyword 40 :string 49 :character 58)) string-to-number alist-get :form nil t intern parseclj-lex--string-value parseclj-lex--character-value] 5 (#$ . 4332)]) #@43 Return t if char at point is white space. (defalias 'parseclj-lex-at-whitespace-p #[nil "`f\211\301=\206\302=\206\303=\206\304=\206\305=)\207" [char 32 9 10 13 44] 3 (#$ . 4953)]) #@42 Return t if point is at the end of file. (defalias 'parseclj-lex-at-eof-p #[nil "`d=\207" [] 2 (#$ . 5152)]) #@82 Consume all consecutive white space as possible and return an :whitespace token. (defalias 'parseclj-lex-whitespace #[nil "`\301 \203 \302 \210\202\303\304\305`\"#)\207" [pos parseclj-lex-at-whitespace-p right-char parseclj-lex-token :whitespace buffer-substring-no-properties] 5 (#$ . 5267)]) #@42 Skip all consecutive digits after point. (defalias 'parseclj-lex-skip-digits #[nil "`f\205\300`fX\205`f\301X\205\302 \210\202\207" [48 57 right-char] 2 (#$ . 5573)]) #@46 Skip all consecutive hex digits after point. (defalias 'parseclj-lex-skip-hex #[nil "`f\205&\300\301`f\302#\204 \300\303`f\304#\204 \300\305`f\306#\205&\307 \210\202\207" [<= 48 57 97 102 65 70 right-char] 4 (#$ . 5753)]) #@25 Skip a number at point. (defalias 'parseclj-lex-skip-number #[nil "`f\300=\203`Tf\301=\203\302\303!\210\304 \207`f\305>\203 \302 \210\306 \210`f\307=\203-\302 \210\306 \207" [48 120 right-char 2 parseclj-lex-skip-hex (43 45) parseclj-lex-skip-digits 46] 2 (#$ . 5987)]) #@64 Consume a number and return a `:number' token representing it. (defalias 'parseclj-lex-number #[nil "`\302 \210`f\303>\203\304 \210\302 \210`f\305=\203\304 \210`f\211\203K\306 X\203/ \307X\204A\310 X\203; \311X\204A \312>\203K\304 \210\313\314\"\202S\315\316\317`\"#*\207" [pos char parseclj-lex-skip-number (69 101 114) right-char 77 97 122 65 90 (46 42 43 33 45 95 63 36 38 61 60 62 47) parseclj-lex-error-token :invalid-number-format parseclj-lex-token :number buffer-substring-no-properties] 6 (#$ . 6269)]) #@30 Return t if CHAR is a digit. (defalias 'parseclj-lex-digit-p #[(char) "\205 \301X\205 \302X\207" [char 48 57] 2 (#$ . 6803)]) #@35 Return t if point is at a number. (defalias 'parseclj-lex-at-number-p #[nil "`f\301!\206\302>\205\301`Tf!)\207" [char parseclj-lex-digit-p (45 43 46)] 2 (#$ . 6940)]) #@394 Return t if CHAR is a valid start for a symbol. Symbols begin with a non-numeric character and can contain alphanumeric characters and . * + ! - _ ? $ % & = < > '. If - + or . are the first character, the second character (if any) must be non-numeric. In some cases, like in tagged elements, symbols are required to start with alphabetic characters only. ALPHA-ONLY ensures this behavior. (defalias 'parseclj-lex-symbol-start-p #[(char &optional alpha-only) "\205$\302X\203\303X\206$\304X\203\305X\206$ ?\205$\306>??\207" [char alpha-only 97 122 65 90 (46 42 43 33 45 95 63 36 37 38 61 60 62 47 39)] 2 (#$ . 7121)]) #@142 Return t if CHAR is a valid character in a symbol. For more information on what determines a valid symbol, see `parseclj-lex-symbol-start-p' (defalias 'parseclj-lex-symbol-rest-p #[(char) "\301!\206\302!\206\303=\206\304=\207" [char parseclj-lex-symbol-start-p parseclj-lex-digit-p 58 35] 2 (#$ . 7762)]) #@39 Return the symbol at POS as a string. (defalias 'parseclj-lex-get-symbol-at-point #[(pos) "\301`f!\203 \302 \210\202\303`\"\207" [pos parseclj-lex-symbol-rest-p right-char buffer-substring-no-properties] 3 (#$ . 8083)]) #@150 Return a lex token representing a symbol. Because of their special meaning, symbols "nil", "true", and "false" are returned as their own lex tokens. (defalias 'parseclj-lex-symbol #[nil "`\302 \210\303!\211\304\267\202'\305\306\307#\202,\305\310\311#\202,\305\312\313#\202,\305\314 #*\207" [pos sym right-char parseclj-lex-get-symbol-at-point #s(hash-table size 3 test equal rehash-size 1.5 rehash-threshold 0.8125 purecopy t data ("nil" 15 "true" 23 "false" 31)) parseclj-lex-token :nil "nil" :true "true" :false "false" :symbol] 5 (#$ . 8314)]) #@78 Helper for string/regex lexing. Returns either the string, or an error token (defalias 'parseclj-lex-string* #[nil "`\301 \210`f\302=\204%\303 \204%`f\304=\203\301\305!\210\202\301 \210\202`f\302=\2053\301 \210\306`\")\207" [pos right-char 34 parseclj-lex-at-eof-p 92 2 buffer-substring-no-properties] 3 (#$ . 8878)]) #@133 Return a lex token representing a string. If EOF is reached without finding a closing double quote, a :lex-error token is returned. (defalias 'parseclj-lex-string #[nil "`\302 \203\303\304 #\202\305 \306\"*\207" [str pos parseclj-lex-string* parseclj-lex-token :string parseclj-lex-error-token :invalid-string] 4 (#$ . 9214)]) #@145 Return a lex token representing a regular expression. If EOF is reached without finding a closing double quote, a :lex-error token is returned. (defalias 'parseclj-lex-regex #[nil "`S\302 \203\303\304\305P #\202\306 \307\"*\207" [str pos parseclj-lex-string* parseclj-lex-token :regex "#" parseclj-lex-error-token :invalid-regex] 4 (#$ . 9556)]) #@56 Return a lookahead string of N characters after point. (defalias 'parseclj-lex-lookahead #[(n) "\301``\\d^\"\207" [n buffer-substring-no-properties] 4 (#$ . 9916)]) #@46 Return a lex token representing a character. (defalias 'parseclj-lex-character #[nil "`\302 \210\303\304!\305\232\203\302\304!\210\306\307\310`\"#\202\256\303\311!\312\232\2033\302\311!\210\306\307\310`\"#\202\256\303\313!\314\232\203J\302\313!\210\306\307\310`\"#\202\256\303\315!\316\232\203a\302\315!\210\306\307\310`\"#\202\256\317\303\311!\320\321\322#)\266\203\203\202\302\311!\210\306\307\310`\"#\202\256\323\303\324!\320\321\322#)\266\203\203\243\302\324!\210\306\307\310`\"#\202\256\302 \210\306\307\310`\"#)\207" [pos inhibit-changing-match-data right-char parseclj-lex-lookahead 3 "tab" parseclj-lex-token :character buffer-substring-no-properties 5 "space" 6 "return" 7 "newline" "^u[0-9a-fA-F]\\{4\\}" nil t string-match "^o[0-8]\\{3\\}" 4] 7 (#$ . 10088)]) #@198 Return a lex token representing a keyword. Keywords follow the same rules as symbols, except they start with one or two colon characters. See `parseclj-lex-symbol', `parseclj-lex-symbol-start-p'. (defalias 'parseclj-lex-keyword #[nil "`\301 \210`f\302=\203\301 \210`f\302=\203 \301 \210\303\304\"\202<\305`f!\204.`f\306=\2034\301 \210\202 \307\310\311`\"#)\207" [pos right-char 58 parseclj-lex-error-token :invalid-keyword parseclj-lex-symbol-rest-p 35 parseclj-lex-token :keyword buffer-substring-no-properties] 5 (#$ . 10902)]) #@44 Return a lex token representing a comment. (defalias 'parseclj-lex-comment #[nil "`\301 b\210`f\302=\203\303 \210\304\305\306`\"#)\207" [pos line-end-position 10 right-char parseclj-lex-token :comment buffer-substring-no-properties] 5 (#$ . 11450)]) #@47 Return a lex token representing a map prefix. (defalias 'parseclj-lex-map-prefix #[nil "`S\301 \210`f\302=\203\301 \210\303`f!\203\301 \210\202\304\305\306`\"#)\207" [pos right-char 58 parseclj-lex-symbol-rest-p parseclj-lex-token :map-prefix buffer-substring-no-properties] 5 (#$ . 11711)]) #@91 Consume characters at point and return the next lexical token. See `parseclj-lex-token'. (defalias 'parseclj-lex-next #[nil "\302 \203 \303\304\305`#\207`f`\306 \203\307 \202\201 \310\267\202\225\311 \210\303\312\313#\202\201\311 \210\303\314\315#\202\201\311 \210\303\316\317#\202\201\311 \210\303\320\321#\202\201\311 \210\303\322\323#\202\201\311 \210\303\324\325#\202\201\311 \210\303\326\327#\202\201\311 \210\303\330\331#\202\201\311 \210`f\332=\203\215\311 \210\303\333\334#\202\201\303\335\336#\202\201\337 \203\237\340 \202\201\341 !\203\252\342 \202\201 \343\267\202y\344 \202\201\345 \202\201\346 \202\201\347 \202\201\311 \210\303\350\351#\202\201\311 \210\303\352\353#\202\201\311 \210`f\211\354\267\202D\311 \210\303\355\356#\202u\311 \210\303\357\360#\202u\311 \210\303\361\362#\202u\311 \210\303\363\364#\202u\311 \210\303\365\366#\202u\367 \202u\370 \202u\311 \210`f\332=\203<\311 \210\303\371\372#\202u\303\373\374#\202u\341 \375\"\203]\311 \210\303\376\377\201@T!P#\202u\306 \204m\302 \204m\311 \210\202]\201A\201B\")\202\201\311 \210\201A!*\207" [pos char parseclj-lex-at-eof-p parseclj-lex-token :eof nil parseclj-lex-at-whitespace-p parseclj-lex-whitespace #s(hash-table size 9 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (40 32 41 43 91 54 93 65 123 76 125 87 39 98 96 109 126 120)) right-char :lparen "(" :rparen ")" :lbracket "[" :rbracket "]" :lbrace "{" :rbrace "}" :quote "'" :backquote "`" 64 :unquote-splice "~@" :unquote "~" parseclj-lex-at-number-p parseclj-lex-number parseclj-lex-symbol-start-p parseclj-lex-symbol #s(hash-table size 7 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (34 176 92 181 58 186 59 191 94 196 64 207 35 218)) parseclj-lex-string parseclj-lex-character parseclj-lex-keyword parseclj-lex-comment :metadata "^" :deref "@" #s(hash-table size 8 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (123 230 95 241 40 252 39 263 61 274 34 285 58 290 63 295)) :set "#{" :discard "#_" :lambda "#(" :var "#'" :eval "#=" parseclj-lex-regex parseclj-lex-map-prefix :reader-conditional-splice "#?@" :reader-conditional "#?" t :tag "#" parseclj-lex-get-symbol-at-point parseclj-lex-error-token :invalid-hashtag-dispatcher] 6 (#$ . 12018)]) (provide 'parseclj-lex)