(*satisfy pred)
Returns a parser that parses a sequence of zero or more characters
satisfying pred
, and returns them as a string.
Similar to:
manySatisfy
Returns a parser that parses a sequence of zero or more characters satisfying `pred`, and returns them as a string. Similar to: - fparsec: `manySatisfy`
(*skip-satisfy pred)
Like *satisfy
, but returns nil
.
Like `*satisfy`, but returns `nil`.
This parser skips over zero or more space characters.
Similar to:
spaces
This parser skips over zero or more space characters. Similar to: - fparsec: `spaces`
(*str p)
Returns a parser that matches p
zero or more times and returns a string of
the concatenated results of p
.
Similar to:
manyChars
, manyStrings
Returns a parser that matches `p` zero or more times and returns a string of the concatenated results of `p`. Similar to: - fparsec: `manyChars`, `manyStrings`
(*str-until p pend)
(*str-until p pend include-end?)
Returns a parser that repeatedly applies the parser p
for as long
as pend
fails (without changing the parser state). It returns a string
concatenation of the results returned by p
.
When include-end?
is true, also includes the result of pend
in the
returned collection.
Similar to:
manyCharsTill
Returns a parser that repeatedly applies the parser `p` for as long as `pend` fails (without changing the parser state). It returns a string concatenation of the results returned by `p`. When `include-end?` is true, also includes the result of `pend` in the returned collection. Similar to: - fparsec: `manyCharsTill`
(+satisfy pred)
Like *satisfy
, but requires pred
to succeed at least once.
Similar to:
many1Satisfy
Like `*satisfy`, but requires `pred` to succeed at least once. Similar to: - fparsec: `many1Satisfy`
(+skip-satisfy pred)
(+skip-satisfy pred label)
Like +satisfy
, but returns nil
.
Like `+satisfy`, but returns `nil`.
This parser skips over one or more space characters.
Similar to:
spaces1
This parser skips over one or more space characters. Similar to: - fparsec: `spaces1`
(+str p)
Like *str
, but requires p
to match at least ocne.
Similar to:
many1Chars
, many1Strings
Like `*str`, but requires `p` to match at least ocne. Similar to: - fparsec: `many1Chars`, `many1Strings`
(+str-until p pend)
(+str-until p pend include-end?)
Like *str-until
, but requires p
to succeed at least once.
Similar to:
many1CharsTill
Like `*str-until`, but requires `p` to succeed at least once. Similar to: - fparsec: `many1CharsTill`
(any-of s)
Returns a parser that succeeds if the next character in the input stream
is contained in the string s
.
Returns a parser that succeeds if the next character in the input stream is contained in the string `s`.
(char ch)
Returns a parser that succeeds if ch
comes next in the input stream and
returns the character ch
.
Similar to:
pchar
Returns a parser that succeeds if `ch` comes next in the input stream and returns the character `ch`. Similar to: - fparsec: `pchar`
(char-range min-ch max-ch)
(char-range min-ch max-ch label)
Returns a parser that succeeds if the next character in the
input stream is within the range [min-ch max-ch]
(inclusive).
Example: (char-range \a \z)
matches a lower-case ASCII character.
Returns a parser that succeeds if the next character in the input stream is within the range `[min-ch max-ch]` (inclusive). Example: `(char-range \a \z)` matches a lower-case ASCII character.
(char-return ch value)
Returns a parser that succeeds if ch
comes next in the input stream,
returning value
.
Returns a parser that succeeds if `ch` comes next in the input stream, returning `value`.
(column-index pos)
Returns the column index of the position pos
. The first column index is 0.
Returns the column index of the position `pos`. The first column index is 0.
(line-index pos)
Returns the line index of the position pos
. The first line index is 0.
Returns the line index of the position `pos`. The first line index is 0.
Parses a lower-case letter character.
Parses a lower-case letter character.
Parses a common newline sequence: \n
, \r
,
or \r\n
, normalizing the return value to \n
.
Parses a common newline sequence: `\n`, `\r`, or `\r\n`, normalizing the return value to `\n`.
(newline-return value)
Returns a parser that matches a newline sequence and returns x
.
Returns a parser that matches a newline sequence and returns `x`.
(none-of s)
Returns a parser that succeeds if the next character in the input stream
is not contained in the string s
.
Returns a parser that succeeds if the next character in the input stream is not contained in the string `s`.
(peek-char ch)
Returns a parser that succeeds if the character ch
comes next, without
changing parser state.
Returns a parser that succeeds if the character `ch` comes next, without changing parser state.
(position source reply)
This parser returns the current position in the input stream.
This parser returns the current position in the input stream.
(regex re)
(regex re label)
Returns a parser that matches the regular expression pattern re
at the
current source position and returns the matched string.
Returns a parser that matches the regular expression pattern `re` at the current source position and returns the matched string.
(regex-groups re)
(regex-groups re label)
Returns a parser that matches the regular expression pattern re
at the current source position and returns the matched string or a vector of
groups like re-groups
.
Returns a parser that matches the regular expression pattern `re` at the current source position and returns the matched string or a vector of groups like `re-groups`.
(satisfy pred)
(satisfy pred label)
Returns a parser that succeeds if the next character in the input
stream satisfies the predicate pred
, and returns the accepted character.
Otherwise, the parser fails without changing the parser state.
Returns a parser that succeeds if the next character in the input stream satisfies the predicate `pred`, and returns the accepted character. Otherwise, the parser fails without changing the parser state.
(skipped p)
Returns a parser that applies the parser p
and returns the skipped source
characters as a string (ignoring the result of p
).
Returns a parser that applies the parser `p` and returns the skipped source characters as a string (ignoring the result of `p`).
This parser matches a common whitespace character: space, tabulator, newline or carriage return.
This parser matches a common whitespace character: space, tabulator, newline or carriage return.
(strcat & ps)
Returns a parser that applies the parsers ps
in sequence and returns
the string concatenation of their return values
Returns a parser that applies the parsers `ps` in sequence and returns the string concatenation of their return values
(string s)
Returns a parser that succeeds if the string s
comes next in the input
stream.
This parser is atomic: it does not change the input state when only a prefix
of s
matches.
As an optimisation, this parser skips line tracking, therefore s
cannot
contain newlines.
Similar to:
pstring
Returns a parser that succeeds if the string `s` comes next in the input stream. This parser is atomic: it does not change the input state when only a prefix of `s` matches. As an optimisation, this parser skips line tracking, therefore `s` cannot contain newlines. Similar to: - fparsec: `pstring`
(string-ci s)
Like string
, but matches s
case-insensitive.
Like `string`, but matches `s` case-insensitive.
(string-return s x)
Like (return (string s) x)
.
Like `(return (string s) x)`.
This parser matches a tabulator character.
This parser matches a tabulator character.
Parses any Unicode newline sequence and returns \n
.
Parses any Unicode newline sequence and returns `\n`.
This parser matches any Unicode whitespace character.
This parser matches any Unicode whitespace character.
Parses an upper-case letter character.
Parses an upper-case letter character.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close