Parser that matches any element from the input seq, it will return the parsed element from the seq.
Parser that matches any element from the input seq, it will return the parsed element from the seq.
Parser that never fails, it returns true
when the end-of-input
is reached, false
otherwise.
Parser that never fails, it returns `true` when the end-of-input is reached, `false` otherwise.
(char c)
Parser that matches only a token that is equal to character c
, the
character is returned.
Parser that matches only a token that is equal to character `c`, the character is returned.
Basic parser that will ensure the request of more input via a continuation.
Basic parser that will ensure the request of more input via a continuation.
Parser that matches any character that is considered a digit, it uses
Character/isDigit
internally. This parser will return the matched digit
character.
Parser that matches any character that is considered a digit, it uses `Character/isDigit` internally. This parser will return the matched digit character.
Parser that matches only when the end-of-input has been reached, otherwise it fails. Returns a nil value.
Parser that matches only when the end-of-input has been reached, otherwise it fails. Returns a nil value.
(ensure n)
If at least n
items of input are available, return the current input,
otherwise fail.
If at least `n` items of input are available, return the current input, otherwise fail.
Parser that matches different end-of-line characters/sequences. This parser returns a nil value.
Parser that matches different end-of-line characters/sequences. This parser returns a nil value.
Returns the input given in the zetta.core/parse
function.
Returns the input given in the `zetta.core/parse` function.
Parser that matches any character that is considered a letter, it uses
Character/isLetter
internally. This parser will return the matched
character.
Parser that matches any character that is considered a letter, it uses `Character/isLetter` internally. This parser will return the matched character.
(not-char c)
Parser that matches only an item that is not equal to character c
, the
item is returned.
Parser that matches only an item that is not equal to character `c`, the item is returned.
Parser that matches one or more digit characters and returns a number in base 10.
Parser that matches one or more digit characters and returns a number in base 10.
(put s)
(satisfy? pred)
Parser that succeeds for any item for which the predicate pred
returns
true
. Returns the item that is actually parsed.
Parser that succeeds for any item for which the predicate `pred` returns `true`. Returns the item that is actually parsed.
(skip pred)
Parser that succeeds for any item for which the predicate pred
, returns
nil
.
Parser that succeeds for any item for which the predicate `pred`, returns `nil`.
Parser that skips many spaces. Returns nil
.
Parser that skips many spaces. Returns `nil`.
(skip-while pred)
Parser that skips input for as long as pred
returns true
.
Parser that skips input for as long as `pred` returns `true`.
Parser that skips many whitespaces. Returns nil
.
Parser that skips many whitespaces. Returns `nil`.
Parser that matches any character that is equal to the character \space
.
This parser returns the \space
character.
Parser that matches any character that is equal to the character `\space`. This parser returns the `\space` character.
Parser that matches many spaces. Returns a seq of space characters
Parser that matches many spaces. Returns a seq of space characters
(string s)
Parses a sequence of items that identically match a given string s
.
Returns the parsed string. This parser consumes no input if it fails (even
with a partial match).
Parses a sequence of items that identically match a given string `s`. Returns the parsed string. This parser consumes no input if it fails (even with a partial match).
(take n)
Parser that matches exactly n
items from input. Returnes the matched
input as a seq.
Parser that matches exactly `n` items from input. Returnes the matched input as a seq.
Parser that returns the rest of the seqs that are given to the parser, the result will be a seqs of seqs where the number of seqs from the first level will represent the number of times a continuation was used to continue the parse process.
Parser that returns the rest of the seqs that are given to the parser, the result will be a seqs of seqs where the number of seqs from the first level will represent the number of times a continuation was used to continue the parse process.
(take-till pred)
Matches input as long as pred
returns false
(i.e. until it returns true
), and returns the consumed input as a seq.
This parser does not fail. It will return an empty seq if the predicate
returns true
on the first item from the input.
WARNING: Because this parser does not fail, do not use it with combinators
such as many
, because such parsers loop until a failure occurs. Careless
use will thus result in an infinite loop.
Matches input as long as `pred` returns `false` (i.e. until it returns `true`), and returns the consumed input as a seq. This parser does not fail. It will return an empty seq if the predicate returns `true` on the first item from the input. **WARNING**: Because this parser does not fail, do not use it with combinators such as `many`, because such parsers loop until a failure occurs. Careless use will thus result in an infinite loop.
(take-while pred)
Parser that matches input as long as pred returns true
, and return
the consumed input as a seq.
This parser does not fail. It will return an empty seq if the predicate
returns false
on the first token of input.
WARNING: Because this parser does not fail, do not use it with
combinators such as many
, because such parsers loop until a failure
occurs. Careless use will thus result in an infinite loop.
Parser that matches input as long as pred returns `true`, and return the consumed input as a seq. This parser does not fail. It will return an empty seq if the predicate returns `false` on the first token of input. **WARNING**: Because this parser does not fail, do not use it with combinators such as `many`, because such parsers loop until a failure occurs. Careless use will thus result in an infinite loop.
(take-while1 pred)
Parser that matches input as long as pred returns true
. This parser
returns the consumed input in a seq.
This parser will fail if a first match is not accomplished.
Parser that matches input as long as pred returns `true`. This parser returns the consumed input in a seq. This parser will fail if a first match is not accomplished.
(take-with n pred)
Parser that matches n
items of input, but succeed only if the predicate
pred
returns true
on the parsed input. The matched input is returned
as a seq.
Parser that matches `n` items of input, but succeed only if the predicate `pred` returns `true` on the parsed input. The matched input is returned as a seq.
Parser that returns true
if any input is available either immediately or
on demand, and false
if the end of all input has been reached.
WARNING: This parser return succeeds.
Parser that returns `true` if any input is available either immediately or on demand, and `false` if the end of all input has been reached. **WARNING**: This parser return succeeds.
Parser that matches any character that is considered a whitespace, it uses
Character/isWhitespace
internally. This parser returns the whitespace
character.
Parser that matches any character that is considered a whitespace, it uses `Character/isWhitespace` internally. This parser returns the whitespace character.
Parser that matches a word, e.g (many1 letter)
, returns the parsed word.
Parser that matches a word, e.g `(many1 letter)`, returns the parsed word.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close