Liking cljdoc? Tell your friends :D

paco.core


*clj/s

(* p)

Zero or more.

Zero or more.
sourceraw docstring

*sep-byclj/s

(*sep-by p psep)
(*sep-by p psep end?)
source

*skipclj/s

(*skip p)
source

*skip-sep-byclj/s

(*skip-sep-by p psep)
(*skip-sep-by p psep end?)
source

*skip-untilclj/s

(*skip-until p pend)
source

*untilclj/s

(*until p pend)
(*until p pend include-end?)
source

+clj/s

(+ p)

One or more.

One or more.
sourceraw docstring

+sep-byclj/s

(+sep-by p psep)
(+sep-by p psep end?)
source

+skipclj/s

(+skip p)
source

+skip-sep-byclj/s

(+skip-sep-by p psep)
(+skip-sep-by p psep end?)
source

+skip-untilclj/s

(+skip-until p pend)
source

+untilclj/s

(+until p pend)
(+until p pend include-end?)
source

?clj/s

(? p)
(? p not-found)

Optional: zero or one.

Optional: zero or one.
sourceraw docstring

?atomicclj/s

(?atomic p)
(?atomic p not-found)

Returns a parser that applies p and if p fails, backtracks to the original state and succeeds with value not-found (default: nil).

(?atomic p) is an optimized implementation of (? (atomic p)).

Returns a parser that applies `p` and if `p` fails, backtracks to the
original state and _succeeds_ with value `not-found` (default: `nil`).

`(?atomic p)` is an optimized implementation of `(? (atomic p))`.
sourceraw docstring

altclj/s

(alt p1)
(alt p1 p2)
(alt p1 p2 p3)
(alt p1 p2 p3 & more)
source

altsclj/s

(alts ps)
(alts ps label')
source

any-tokenclj/s

(any-token source reply)
source

atomicclj/s

(atomic p)

Returns a parser that behaves like p, except that it backtracks to the original parser state when p fails with changing the parser state.

Returns a parser that behaves like `p`, except that it backtracks to
the original parser state when `p` fails with changing the parser
state.
sourceraw docstring

betweenclj/s

(between p psurround)
(between p popen pclose)
source

bindclj/s

(bind p f)
source

catclj/s

(cat & ps)
source

cat*clj/s

(cat* ps)
source

derefclj/s

(deref ref)

Returns a parser that forwards all calls to the parser returned by @ref. Useful to construct recursive parsers.

Returns a parser that forwards all calls to the parser returned
by `@ref`.  Useful to construct recursive parsers.
sourceraw docstring

endclj/s

(end source reply)

This parser succeeds a the end of the input stream.

This parser succeeds a the end of the input stream.
sourceraw docstring

failclj/s

(fail message)
source

followed-byclj/s

(followed-by p)
(followed-by p label)

Returns a parser that succeeds if it is followed by p, e.g. if p succeeds next. Does not change the parser state.

Returns a parser that succeeds if it is followed by `p`, e.g. if `p`
succeeds next.  Does not change the parser state.
sourceraw docstring

fwdclj/smacro

(fwd expr)

Returns a parser that forwards to expr. Useful for recursive parsers to use a parser that has been declared but not yet defined:

(def expr (p/alt c/digit
                 (p/between (p/fwd expr) (c/char \() (c/char \)))))

Warning: Left-recursive parsers are not supported and will lead to infinite loops / stack overflows.

Returns a parser that forwards to `expr`.  Useful for recursive parsers
to use a parser that has been declared but not yet defined:

```clojure
(def expr (p/alt c/digit
                 (p/between (p/fwd expr) (c/char \() (c/char \)))))
```

**Warning**: Left-recursive parsers are not supported and will lead to
infinite loops / stack overflows.
sourceraw docstring

indexclj/s

(index source reply)

Returns the index of the next token in the input stream.

Returns the index of the next token in the input stream.
sourceraw docstring

labelclj/s

(label p label)

If p does not change the parser state, the errors are replaced with `(expected label).

If `p` does not change the parser state, the errors are
replaced with `(expected label).
sourceraw docstring

label-compoundclj/s

(label-compound p label)
source

lazyclj/smacro

(lazy & body)
source

look-aheadclj/s

(look-ahead p)
source

mapclj/s

(map p f)
(map p1 p2 f)
(map p1 p2 p3 f)
(map p1 p2 p3 p4 & more)

Returns a parser that applies the provided parsers in sequence and returns the return value of calling f with the return values.

Returns a parser that applies the provided parsers in sequence and returns
the return value of calling `f` with the return values.
sourceraw docstring

maxclj/s

(max p n)
source

minclj/s

(min p n)
source

not-emptyclj/s

(not-empty p)

Like p, but fails when p does not change the parser state.

Like `p`, but fails when `p` does not change the parser state.
sourceraw docstring

not-followed-byclj/s

(not-followed-by p)
(not-followed-by p label)

Returns a parser that succeeds if the parser p fails, and fails otherwise. In both cases, it does not change the parser state.

Returns a parser that succeeds if the parser `p` fails, and fails otherwise.
In both cases, it does not change the parser state.
sourceraw docstring

parseclj/s

(parse p input & {:as opts})

Applies the parser p to input and returns its result value. Throws an exception when p fails.

Applies the parser `p` to `input` and returns its result value.  Throws
an exception when `p` fails.
sourceraw docstring

pforceclj/s

(pforce d)

Returns a parser that forwards to (force d).

Returns a parser that forwards to `(force d)`.
sourceraw docstring

pnilclj/s

This parser always succeeds and returns nil.

This parser always succeeds and returns `nil`.
sourceraw docstring

posclj/s

(pos source reply)

Returns the current position in the input stream.

Returns the current position in the input stream.
sourceraw docstring

recclj/s

(rec f)

Creates a recursive parser. Calls f with one arg, a parser to recur, and returns the parser returned by f.

It is assumed that f uses p/alt or similar to eventually stop the recursion.

Creates a recursive parser.  Calls `f` with one arg, a parser to recur,
and returns the parser returned by `f`.

It is assumed that `f` uses `p/alt` or similar to eventually stop the
recursion.
sourceraw docstring

repeatclj/s

(repeat p n)
(repeat p min max)
source

returnclj/s

(return x)
(return p x)
source

runclj/s

(run p input & {:as opts})

Applies the parser p to input and returns a map representing the parser result.

Applies the parser `p` to `input` and returns a map representing the
parser result.
sourceraw docstring

set-user-stateclj/s

(set-user-state u)

Sets the user source to u.

Sets the user source to `u`.
sourceraw docstring

skip-any-tokenclj/s

(skip-any-token source reply)
source

swap-user-stateclj/s

(swap-user-state f & args)

Sets ths user source to (apply f user-state args).

Sets ths user source to `(apply f user-state args)`.
sourceraw docstring

thenclj/s

(then p)
(then p1 p2)
(then p1 p2 p3)
(then p1 p2 p3 p4 & more)

Applies the parsers in sequence and returns the result of the last one.

Applies the parsers in sequence and returns the result of the last one.
sourceraw docstring

then-skipclj/s

(then-skip p)
(then-skip p1 p2)
(then-skip p1 p2 p3)
(then-skip p1 p2 p3 p4 & more)

Applies the parsers in sequence and returns the result of the first one.

Applies the parsers in sequence and returns the result of the first one.
sourceraw docstring

tokenclj/s

(token token)
source

token-returnclj/s

(token-return token value)
source

tupleclj/s

(tuple p)
(tuple p1 p2)
(tuple p1 p2 p3)
(tuple p1 p2 p3 p4 & more)
source

tuple*clj/s

(tuple* ps)

Applies the parsers ps in sequence and returns a vector of their return values.

Applies the parsers `ps` in sequence and returns a vector of
their return values.
sourceraw docstring

user-stateclj/s

(user-state source reply)

Returns the current user state.

Returns the current user state.
sourceraw docstring

user-state-satisfyclj/s

(user-state-satisfy pred)

Succeeds if pred returns logical true when called with the current user source, otherwise it fails. Returns the return value of pred.

Succeeds if `pred` returns logical true when called with the current
user source, otherwise it fails.  Returns the return value of `pred`.
sourceraw docstring

withclj/smacro

(with bindings & body)
source

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

× close