(compile-section direction prev {:keys [type step] optional? :? :as section})compile section (compile-section :up nil '{:element if, :type :nth, :step 3}) => '{:nth-ancestor [3 {:form if}]}
(compile-section :down nil '{:element if, :type :multi}) => '{:contains {:form if}}
compile section
(compile-section :up nil '{:element if, :type :nth, :step 3})
=> '{:nth-ancestor [3 {:form if}]}
(compile-section :down nil '{:element if, :type :multi})
=> '{:contains {:form if}}(compile-section-base section)compiles an element section (compile-section-base '{:element defn}) => '{:form defn}
(compile-section-base '{:element (if & _)}) => '{:pattern (if & _)}
(compile-section-base '{:element _}) => {:is code.query.common/any}
compiles an element section
(compile-section-base '{:element defn})
=> '{:form defn}
(compile-section-base '{:element (if & _)})
=> '{:pattern (if & _)}
(compile-section-base '{:element _})
=> {:is code.query.common/any}(compile-submap direction sections)compile submap (compile-submap :down (process-path '[if try])) => '{:child {:child {:form if}, :form try}}
(compile-submap :up (process-path '[defn if])) => '{:parent {:parent {:form defn}, :form if}}
compile submap
(compile-submap :down (process-path '[if try]))
=> '{:child {:child {:form if}, :form try}}
(compile-submap :up (process-path '[defn if]))
=> '{:parent {:parent {:form defn}, :form if}}(cursor-info selectors)finds the information related to the cursor
(cursor-info '[(defn ^:?& _ | & _)]) => '[0 :form (defn _ | & _)]
(cursor-info (expand-all-metas '[(defn ^:?& _ | & _)])) => '[0 :form (defn _ | & _)]
(cursor-info '[defn if]) => [nil :cursor]
(cursor-info '[defn | if]) => [1 :cursor]
finds the information related to the cursor (cursor-info '[(defn ^:?& _ | & _)]) => '[0 :form (defn _ | & _)] (cursor-info (expand-all-metas '[(defn ^:?& _ | & _)])) => '[0 :form (defn _ | & _)] (cursor-info '[defn if]) => [nil :cursor] (cursor-info '[defn | if]) => [1 :cursor]
(expand-all-metas selectors)converts the shorthand meta into a map-based meta (meta (expand-all-metas '^:%? sym?)) => {:? true, :% true}
(-> (expand-all-metas '(^:%+ + 1 2)) first meta) => {:+ true, :% true}
converts the shorthand meta into a map-based meta
(meta (expand-all-metas '^:%? sym?))
=> {:? true, :% true}
(-> (expand-all-metas '(^:%+ + 1 2))
first meta)
=> {:+ true, :% true}(prepare selectors)prepare (prepare '[defn if]) => '[{:child {:form if}, :form defn} [nil :cursor]]
(prepare '[defn | if]) => '[{:parent {:form defn}, :form if} [1 :cursor]]
prepare
(prepare '[defn if])
=> '[{:child {:form if}, :form defn} [nil :cursor]]
(prepare '[defn | if])
=> '[{:parent {:form defn}, :form if} [1 :cursor]](process-path path)(process-path [x y & xs :as more] out)converts a path into more information (process-path '[defn if try]) => '[{:type :step, :element defn} {:type :step, :element if} {:type :step, :element try}]
(process-path '[defn :* try :3 if]) => '[{:type :step, :element defn} {:element try, :type :multi} {:element if, :type :nth, :step 3}]
converts a path into more information
(process-path '[defn if try])
=> '[{:type :step, :element defn}
{:type :step, :element if}
{:type :step, :element try}]
(process-path '[defn :* try :3 if])
=> '[{:type :step, :element defn}
{:element try, :type :multi}
{:element if, :type :nth, :step 3}](process-special ele)converts a keyword into a map (process-special :*) => {:type :multi}
(process-special :1) => {:type :nth, :step 1}
(process-special :5) => {:type :nth, :step 5}
converts a keyword into a map
(process-special :*) => {:type :multi}
(process-special :1) => {:type :nth, :step 1}
(process-special :5) => {:type :nth, :step 5}(split-path selectors [idx ctype])splits the path into up and down (split-path '[defn | if try] [1 :cursor]) => '{:up (defn), :down [if try]}
(split-path '[defn if try] [nil :cursor]) => '{:up [], :down [defn if try]}
splits the path into up and down
(split-path '[defn | if try] [1 :cursor])
=> '{:up (defn), :down [if try]}
(split-path '[defn if try] [nil :cursor])
=> '{:up [], :down [defn if try]}cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |