(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 string.
Parser that matches exactly `n` items from input. Returnes the matched input as a string.
Parser that always success and returns the rest of the seqs that are given to the parser, the result will be a seqs of strings 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 always success and returns the rest of the seqs that are given to the parser, the result will be a seqs of strings 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)
Parser that 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 string 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.
Parser that 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 string 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 string.
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 string. 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 string.
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 string. 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 string.
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 string.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close