Liking cljdoc? Tell your friends :D

zetta.core


*>cljmacro

(*> & more)

Composes two or more parsers returning the result of the rightmost one.

Composes two or more parsers returning the result of the rightmost one.
raw docstring

<$>clj

(<$> f & more)

Maps the function f to the results of the given parsers, applicative functor result is going to be a parameter for function f.

Example:

(<$> + number number)

Where number is a parser that will return a number from the parsed input.

Maps the function f to the results of the given parsers, applicative
functor result is going to be a parameter for function f.

Example:

  (<$> + number number)

Where `number` is a parser that will return a number from the parsed input.
raw docstring

<*cljmacro

(<* & more)

Composes two or more parsers, returning the result of the leftmost one.

Composes two or more parsers, returning the result of the leftmost one.
raw docstring

<|>clj

Alias for join-parsers function.

Alias for join-parsers function.
raw docstring

add-parser-streamclj

(add-parser-stream input0 more0 input1 more1 f)

Concats the input and more flag from two different parsers and calls the function f with the result.

Concats the input and `more` flag from two different parsers and calls
the function f with the result.
raw docstring

alwaysclj

(always a)

Returns a parser that will always succeed, this parser will return the parameter given.

Returns a parser that will always succeed, this parser will return the
parameter given.
raw docstring

bind-parsersclj

(bind-parsers p f)

Receives a parser and a continuation function, the result of the parser is going to be given as a parameter to the f function, and this function should return a new parser.

Example:

; Everytime we parse an 'a' character and return a "hello" string (bind-parsers (char \a) (fn [achr] (always "hello")))

Receives a parser and a continuation function, the result of the parser is
going to be given as a parameter to the f function, and this function should
return a new parser.

Example:

  ; Everytime we parse an 'a' character and return a "hello" string
  (bind-parsers (char \a) (fn [achr] (always "hello")))
raw docstring

completeclj

Constant value that indicates if the stream of the parser is complete (no more input).

Constant value that indicates if the stream
of the parser is complete (no more input).
raw docstring

complete?clj

(complete? m)

Test More flag is equal to the complete constant or not.

Test More flag is equal to the complete constant or not.
raw docstring

do-parsercljmacro

(do-parser & body)

Allows the use of 'run-mdo' statements with the bind and return functions binded to the parser-m monad.

Allows the use of 'run-mdo' statements with the bind and return
functions binded to the parser-m monad.
raw docstring

done?clj

(done? result)

Returns true when the parser has successfuly parsed the given input.

Returns true when the parser has successfuly parsed the
given input.
raw docstring

fail-parserclj

(fail-parser msg)

Parser that will always fail, you may provide an error message msg that will be shown on the final result.

Parser that will always fail, you may provide an error message msg that
will be shown on the final result.
raw docstring

failure?clj

(failure? result)

Returns true when the parser has failed when parsing the given input.

Returns true when the parser has failed when parsing the
given input.
raw docstring

incompleteclj

Constant value that indicates if the stream of the parser is incomplete (more input to come).

Constant value that indicates if the stream
of the parser is incomplete (more input to come).
raw docstring

incomplete?clj

(incomplete? m)

Test More flag is equal to the incomplete constant or not.

Test More flag is equal to the incomplete constant or not.
raw docstring

join-parsersclj

(join-parsers p1 p2)

Merges two parsers together and returns a new parser that will execute parser p1, in case this fails, it is going to execute parser p2.

Example:

;; Parses either the character a or the character b (join-parsers (char \a) (char \b))

Merges two parsers together and returns a new parser that will execute
parser p1, in case this fails, it is going to execute parser p2.

Example:

  ;; Parses either the character a or the character b
  (join-parsers (char \a) (char \b))
raw docstring

parseclj

(parse parser input)

Uses the given parser to process the input, this function may return a result that could either be a success, a failure, or a continuation that will require more input in other to finish. The parser continuation will halt as soon as an empty seq is given.

Uses the given parser to process the input, this function may return a
result that could either be a success, a failure, or a continuation that
will require more input in other to finish. The parser continuation
will halt as soon as an empty seq is given.
raw docstring

parse-onceclj

(parse-once parser input)

Uses the given parser to process the input, this may return a result that could either be a success or failure result (All input must be available at once when using this function).

Uses the given parser to process the input, this may return a result that
could either be a success or failure result (All input must be available
at once when using this function).
raw docstring

parser-mclj


partial?clj

Returns true when the parser requires more input in order to complete.

Returns true when the parser requires more input
in order to complete.
raw docstring

promptclj

(prompt input0 _more0 err-fn ok-fn)

This is parser is used to return continuations (when there is not enough input available for the parser to either succeed or fail).

This is parser is used to return continuations (when there is not
enough input available for the parser to either succeed or fail).
raw docstring

ResultDoneclj


ResultFailureclj


with-parsercljmacro

(with-parser & forms)

Allows the use of monadic functions bind and return which are binded to the parser-m monad.

Allows the use of monadic functions bind and return which are
binded to the parser-m monad.
raw docstring

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

× close