Liking cljdoc? Tell your friends :D

code.query.compile


compile-sectionclj

(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}}
raw docstring

compile-section-baseclj

(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}
raw docstring

compile-submapclj

(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}}
raw docstring

cursor-infoclj

(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]
raw docstring

expand-all-metasclj

(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}
raw docstring

movesclj


prepareclj

(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]]
raw docstring

process-pathclj

(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}]
raw docstring

process-specialclj

(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}
raw docstring

split-pathclj

(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]}
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close