;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\207" [require a seq subr-x parseclj-lex] 2) #@152 Create an AST node with given TYPE and POSITION. Other ATTRIBUTES can be given as a flat list of key-value pairs. (fn TYPE POSITION &rest ATTRIBUTES) (defalias 'parseclj-ast-node #[642 "\300\301\302\303&\207" [apply a-list :node-type :position] 10 (#$ . 193)]) #@62 Return t if the given NODE is a Clojure AST node. (fn NODE) (defalias 'parseclj-ast-node-p #[257 "\211:\205\211@:\205\211@@\300=\207" [:node-type] 3 (#$ . 467)]) #@45 Return NODE's ATTR, or nil. (fn NODE ATTR) (defalias 'parseclj-ast-node-attr #[514 "\300\"\207" [a-get] 5 (#$ . 640)]) #@50 Return the type of the AST node NODE. (fn NODE) (defalias 'parseclj-ast-node-type #[257 "\300\301\"\207" [a-get :node-type] 4 (#$ . 768)]) #@46 Return children for the AST NODE. (fn NODE) (defalias 'parseclj-ast-children #[257 "\300\301\"\207" [a-get :children] 4 (#$ . 915)]) #@58 Return the value of NODE as another AST node. (fn NODE) (defalias 'parseclj-ast-value #[257 "\300\301\"\207" [a-get :value] 4 (#$ . 1056)]) #@59 Return t if the given ast NODE is a leaf node. (fn NODE) (defalias 'parseclj-ast-leaf-node-p #[257 "\301!\235\207" [parseclj-lex--leaf-tokens parseclj-ast-node-type] 3 (#$ . 1204)]) #@61 Return t if the given AST NODE is a branch node. (fn NODE) (defalias 'parseclj-ast-branch-node-p #[257 "\300!?\207" [parseclj-ast-leaf-node-p] 3 (#$ . 1395)]) #@222 Put into the STACK an AST leaf node based on TOKEN. Ignores white spaces and comments. OPTIONS is an association list. See `parseclj-parse' for more information on available options. (fn STACK TOKEN &optional OPTIONS) (defalias 'parseclj-ast--reduce-leaf #[770 "\300!\301>\203\n\207\302\300!\303\304\"\305\303\305\"\306\307!&B\207" [parseclj-lex-token-type (:whitespace :comment) parseclj-ast-node a-get :pos :form :value parseclj-lex--leaf-token-value] 11 (#$ . 1563)]) #@422 Put into STACK an AST leaf node based on TOKEN. This function is very similar to `parseclj-ast--reduce-leaf', but unlike it, takes into account tokens representing white space or comments and saves them into the STACK. Nodes produced by this function have a `:lexical-preservation' key set to t. OPTIONS is an association list. See `parseclj-parse' for more information on available options. (fn STACK TOKEN OPTIONS) (defalias 'parseclj-ast--reduce-leaf-with-lexical-preservation #[771 "\300!@\301>\2035\302\303\"=\203\"\304\305\306\302\305\"$AB\207\307\300!\302\310\"\305\302\305\"$B\207\311#\207" [parseclj-lex-token-type (:whitespace :comment) a-get :node-type a-update :form concat parseclj-ast-node :pos parseclj-ast--reduce-leaf] 12 (#$ . 2055)]) #@396 Reduce STACK with an AST branch node representing a collection of elements. Ignores discard tokens. OPENING-TOKEN is a lex token representing an opening paren, bracket or brace. CHILDREN is the collection of nodes to be reduced into the AST branch node. OPTIONS is an association list. See `parseclj-parse' for more information on available options. (fn STACK OPENING-TOKEN CHILDREN OPTIONS) (defalias 'parseclj-ast--reduce-branch #[1028 "\300\301\"\302!\211\303\267\202\304\202\305\202\306\202\211\211\307\267\202[\310\311\312$B\207\207\310\313\313\314\300 \315\"\316\317O!\312\n&B\207\310\320\312$B\207\321@\322#B\207\310\312$B\207" [a-get :pos parseclj-lex-token-type #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (:lparen 13 :lbracket 17 :lbrace 21)) :list :vector :map #s(hash-table size 5 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (:root 32 :discard 43 :tag 46 :metadata 69 :map-prefix 80)) parseclj-ast-node :root :children :tag intern :form 1 nil :with-meta a-assoc :map-prefix] 15 (#$ . 2839)]) #@529 Reduce STACK with an AST branch node representing a collection of elements. Similar to `parseclj-ast--reduce-branch', but reduces discard tokens as well. Nodes produced by this function have a `:lexical-preservation' key set to t. OPENING-TOKEN is a lex token representing an opening paren, bracket or brace. CHILDREN is the collection of tokens to be reduced into the AST branch node. OPTIONS is an association list. See `parseclj-parse' for more information on available options. (fn STACK OPENING-TOKEN CHILDREN OPTIONS) (defalias 'parseclj-ast--reduce-branch-with-lexical-preservation #[1028 "\300!\301=\203\302\301\303\304\"\305$B\207\306$\211@\307!\203-\211@\310ABBAB\207\207" [parseclj-lex-token-type :discard parseclj-ast-node a-get :pos :children parseclj-ast--reduce-branch parseclj-ast-node-p (:lexical-preservation . t)] 9 (#$ . 3954)]) #@85 Insert a string representation of the given AST branch NODE into buffer. (fn NODE) (defalias 'parseclj-ast--unparse-collection #[257 "\300!\211\301\267\202'\302\211B\202(\303\304B\202(\305\306B\202(\307\310B\202(\311\310B\202(\312\211@c\210\313\314\"\211@\211\203:\315!\210\210\316\317\320\"A\"\266\211Ac\207" [parseclj-ast-node-type #s(hash-table size 5 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (:root 9 :list 15 :vector 21 :set 27 :map 33)) "" "(" ")" "[" "]" "#{" "}" "{" nil alist-get :children parseclj-unparse-clojure seq-do make-closure #[257 "\301\300\302\"\204\n\303c\210\304!\207" [V0 a-get :lexical-preservation " " parseclj-unparse-clojure] 4 "\n\n(fn CHILD)"]] 8 (#$ . 4828)]) #@82 Insert a string representation of the given AST tag NODE into buffer. (fn NODE) (defalias 'parseclj-ast--unparse-tag #[257 "\300c\210\301\302\303\"!c\210\304c\210\305\302\306\"@!\207" ["#" symbol-name a-get :tag " " parseclj-unparse-clojure :children] 5 (#$ . 5564)]) (provide 'parseclj-ast)