Liking cljdoc? Tell your friends :D

infix.parser

Infix expression parser using Shunting Yard algorithm.

Infix expression parser using Shunting Yard algorithm.
raw docstring

parse-infixclj

(parse-infix expr)

Parse infix expression into postfix notation using Shunting Yard algorithm.

Parse infix expression into postfix notation using Shunting Yard algorithm.
sourceraw docstring

tokenizeclj

(tokenize expr)

Convert infix expression into sequence of tokens.

Convert infix expression into sequence of tokens.
sourceraw docstring

transform-function-callsclj

(transform-function-calls expr)
(transform-function-calls expr context)

Transform function call syntax by detecting symbol followed by list pattern.

context tells us how to interpret the first element of expr: :expression — a flat infix/arg-list sequence; every position is eligible for fn(args) pattern matching. :call — the first element is the fn/macro/special-form head of a Clojure call form; skip pattern matching at position 0 so cond in (cond (x = y) 1) isn't treated as fn(args). Additionally, non-head positions are treated as independent arguments: adjacent symbol + (list) pairs are NOT merged into fn-calls there (that would mis-read e.g. (.addAll list (seq items)) as (.addAll (list seq items))).

Transform function call syntax by detecting symbol followed by list pattern.

`context` tells us how to interpret the first element of `expr`:
  :expression — a flat infix/arg-list sequence; every position is eligible
                for fn(args) pattern matching.
  :call       — the first element is the fn/macro/special-form head of a
                Clojure call form; skip pattern matching at position 0 so
                `cond` in `(cond (x = y) 1)` isn't treated as fn(args).
                Additionally, non-head positions are treated as independent
                arguments: adjacent `symbol` + `(list)` pairs are NOT
                merged into fn-calls there (that would mis-read e.g.
                `(.addAll list (seq items))` as `(.addAll (list seq items))`).
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close