Liking cljdoc? Tell your friends :D

protoflex.parse

Clojure Parser Library.

Clojure Parser Library.
raw docstring

*parser-state*clj

source

->fnscljmacro

(->fns & exprs)
source

acloseclj

(aclose)

Matches and returns a closing angular bracket character

Matches and returns a closing angular bracket character
sourceraw docstring

all-opsclj

(all-ops)
source

ang-bracketsclj

(ang-brackets parse-fn)

Returns the result of applying specifed parse function to text that is in between the opening and closing angular brackets '<' and '>'

Returns the result of applying specifed parse function to text that is
in between the opening and closing angular brackets '<' and '>'
sourceraw docstring

anyclj

(any & parse-fns)

Returns the result of the first successfully matching parse-function. If none of the parse functions match, an exception is thrown.

Returns the result of the first successfully matching parse-function.
If none of the parse functions match, an exception is thrown.
sourceraw docstring

any-stringclj

(any-string sep)

Reads a single-quoted or double-quoted or a plain-string that is followed by the specified separator sep or EOF; the separator is not part of the returned string.

Reads a single-quoted or double-quoted or a plain-string that is followed
by the specified separator sep or EOF; the separator is not part of the returned
string.
sourceraw docstring

any_cljmacro

(any_ & parse-exprs)

Creates and returns a parse function that calls any when it is invoked. The arguments parse-exprs are converted to parse functions and passed to any in the returned function's body. See any.

Creates and returns a parse function that calls `any` when it is
invoked. The arguments `parse-exprs` are converted to parse functions
and passed to `any` in the returned function's body.  See `any`.
sourceraw docstring

aopenclj

(aopen)

Matches and returns an opening angular bracket character

Matches and returns an opening angular bracket character
sourceraw docstring

at-end?clj

(at-end?)

Returns true if no more input is left to be read; false otherwise.

Returns true if no more input is left to be read; false otherwise.
sourceraw docstring

attemptclj

(attempt parse-fn)

Tries to match the input at the current position with the provided parse function. If the parse function matches successfully, the matched text is returned and the input cursor advances by the length of the matched text. Otherwise a nil is returned and the current position in the input remains unchanged.

Tries to match the input at the current position with the provided
parse function. If the parse function matches successfully, the matched
text is returned and the input cursor advances by the length of the
matched text. Otherwise a nil is returned and the current position
in the input remains unchanged.
sourceraw docstring

attempt_cljmacro

(attempt_ parse-expr)

Creates and returns a parse function that calls attempt when it is invoked. The argument parse-expr is converted to a parse function and passed to attempt in the returned function's body. See attempt.

Creates and returns a parse function that calls `attempt` when it is
invoked. The argument `parse-expr` is converted to a parse function
and passed to `attempt` in the returned function's body.  See `attempt`.
sourceraw docstring

auto-trim-ifclj

(auto-trim-if)

Automatically trim the leading input text if :auto-trim option is set to true.

Automatically trim the leading input text if :auto-trim option is set to true.
sourceraw docstring

auto-trim-offclj

(auto-trim-off)

Turns off the auto-trim option.

Turns off the auto-trim option.
sourceraw docstring

auto-trim-onclj

(auto-trim-on)

Turns on auto-trim feature that cleans trailing white-space, comments or whatever the custom ws-reader if any is spe

Turns on auto-trim feature that cleans trailing white-space, comments
or whatever the custom ws-reader if any is spe
sourceraw docstring

back-to-markclj

(back-to-mark mark)

Resets the positional parameters to a previously set mark.

Resets the positional parameters to a previously set mark.
sourceraw docstring

bcloseclj

(bclose)

Matches and returns a closing curly brace character

Matches and returns a closing curly brace character
sourceraw docstring

betweenclj

(between start-fn parse-fn end-fn)

Applies the supplied start-fn, parse-fn and end-fn functions and returns the result of parse-fn. This is typically used to parse content enclosed by some delimiters on either side.

Applies the supplied start-fn, parse-fn and end-fn functions and returns
the result of parse-fn. This is typically used to parse content enclosed by
some delimiters on either side.
sourceraw docstring

blk-cmtclj

(blk-cmt beg end)

Reads and returns a block comment as specified by the begin and end markers. Throws an exception if the specified block-comment doesn't occur at the current position.

Reads and returns a block comment as specified by the begin and end
markers.  Throws an exception if the specified block-comment doesn't
occur at the current position.
sourceraw docstring

blk-cmt?clj

(blk-cmt? beg end)

Similar to blk-cmt but returns a nil instead of throwing an exception in case of a match failure.

Similar to blk-cmt but returns a nil instead of throwing an exception
in case of a match failure.
sourceraw docstring

bopenclj

(bopen)

Matches and returns an opening curly brace character

Matches and returns an opening curly brace character
sourceraw docstring

bracesclj

(braces parse-fn)

Returns the result of applying specifed parse function to text that is in between the opening and closing braces '{' and '}'

Returns the result of applying specifed parse function to text that is
in between the opening and closing braces '{' and '}'
sourceraw docstring

build-treeclj

(build-tree nodes)
source

chrclj

(chr ch)

If the next character in the input matches the specified character ch, returns it; otherwise throws an exception.

If the next character in the input matches the specified character ch,
returns it; otherwise throws an exception.
sourceraw docstring

chr-clj

(chr- ch)

Same as chr but with auto-trimming turned off for the following input

Same as chr but with auto-trimming turned off for the following input
sourceraw docstring

chr-inclj

(chr-in chars)

If the next character in the input matches any character in the specified string or character collection, the matching character is returned. Otherwise throws an exception.

If the next character in the input matches any character in the specified
string or character collection, the matching character is returned.
Otherwise throws an exception.
sourceraw docstring

chr-in-clj

(chr-in- chars)

Same as chr-in but with auto-trimming turned off for the following input

Same as chr-in but with auto-trimming turned off for the following input
sourceraw docstring

colonclj

(colon)

Matches and returns a colon character

Matches and returns a colon character
sourceraw docstring

commaclj

(comma)

Matches and returns a comma character

Matches and returns a comma character
sourceraw docstring

commitclj

(commit parse-fn)

Applies supplied parse-fn and if it fails, the failure gets reported as a 'committed' exception, which prevents the parser from trying alternatives at higher levels. On success, returns the result of parse-fn.

Applies supplied parse-fn and if it fails, the failure gets reported as a
'committed' exception, which prevents the parser from trying alternatives at
higher levels. On success, returns the result of parse-fn.
sourceraw docstring

commit-onclj

(commit-on kw parse-fn)

If the keyword kw occurs at the current position in the input text, parse-fn will be applied next. If parse-fn fails, it will get reported as a 'committed' exception, which prevents the parser from trying alternatives at higher levels. On sucess, returns the result of parse-fn.

If the keyword kw occurs at the current position in the input text, parse-fn
will be applied next. If parse-fn fails, it will get reported as a 'committed'
exception, which prevents the parser from trying alternatives at higher levels.
On sucess, returns the result of parse-fn.
sourceraw docstring

cursor-posclj

(cursor-pos)

Returns the current cursor position as a scalar

Returns the current cursor position as a scalar
sourceraw docstring

decimalclj

(decimal)

Parses a decimal value and returns a Double.

Parses a decimal value and returns a Double.
sourceraw docstring

default-optionsclj

source

dotclj

(dot)

Matches and retuns a dot character

Matches and retuns a dot character
sourceraw docstring

dq-strclj

(dq-str)

Parses a double-quoted string and returns the matched string (minus the quotes)

Parses a double-quoted string and returns the matched string (minus the quotes)
sourceraw docstring

equalclj

(equal)

Matches and returns an equal character

Matches and returns an equal character
sourceraw docstring

eval-exprclj

(eval-expr & args)

Parses and evaluates an expression in infix notation. Args: expression-string followed by parser options. See parse function for details.

Parses and evaluates an expression in infix notation.
Args: expression-string followed by parser options.  See parse function for details.
sourceraw docstring

eval-expr-treeclj

(eval-expr-tree ptree)

Evaluates the parse tree returned by expr parse function.

Evaluates the parse tree returned by expr parse function.
sourceraw docstring

expectclj

(expect expected-msg parse-fn)

Customize error message; if the specified parse function doesn't match the current input text, the error message of the parse exception will include the specified custom expected-message.

Customize error message; if the specified parse function doesn't match
the current input text, the error message of the parse exception will include
the specified custom expected-message.
sourceraw docstring

expect_cljmacro

(expect_ expected-msg parse-expr)

Creates and returns a parse function that calls expect when it is invoked. The argument parse-expr is converted to a parse function and passed to expect in the returned function's body. See expect.

Creates and returns a parse function that calls `expect` when it is
invoked. The argument `parse-expr` is converted to a parse function
and passed to `expect` in the returned function's body.  See `expect`.
sourceraw docstring

exprclj

(expr)

Parses expressions and returns the parse tree as nested vectors.

Parses expressions and returns the parse tree as nested vectors.
sourceraw docstring

get-default-op-fn-mapclj

(get-default-op-fn-map)
source

get-default-opsclj

(get-default-ops)
source

get-optclj

(get-opt k)
(get-opt k d)

Returns the value for parser option k; if the optional default value parameter d is specified, its value is returned if the option k is not set in parser options.

Returns the value for parser option k; if the optional default value
parameter d is specified, its value is returned if the option k is not set
in parser options.
sourceraw docstring

get-optsclj

(get-opts)
source

has-priority?clj

(has-priority? op1 op2)
source

identclj

(ident)

Reads an identifier at current input position using the ident-regex parser option. If id is specified, the read identifier must match the specified value; otherwise an exception is thrown.

Reads an identifier at current input position using the ident-regex 
parser option. If id is specified, the read identifier must match the 
specified value; otherwise an exception is thrown.
sourceraw docstring

init-operatorsclj

(init-operators operators)
source

integerclj

(integer)

Parses a long integer value and returns a Long.

Parses a long integer value and returns a Long.
sourceraw docstring

key-wordclj

(key-word kw)

Reads an identifier at the current input position. If the read identifier matches the specified keyword kw, the same is returned; otherwise, an exception is thrown.

Reads an identifier at the current input position. If the read identifier
matches the specified keyword kw, the same is returned; otherwise, an
exception is thrown.
sourceraw docstring

la-strsclj

(la-strs la-pf-vec)
source

lexemeclj

(lexeme parse-fn)

Applies the specified parse function for current input text, consumes any following whitespace, comments and returns the result of the parse function application.

Applies the specified parse function for current input text, consumes any
following whitespace, comments and returns the result of the parse function
application.
sourceraw docstring

lexeme_cljmacro

(lexeme_ parse-expr)

Creates and returns a parse function that calls lexeme when it is invoked. The argument parse-expr is converted to a parse function and passed to lexeme in the returned function's body. See lexeme.

Creates and returns a parse function that calls `lexeme` when it is
invoked. The argument `parse-expr` is converted to a parse function
and passed to `lexeme` in the returned function's body.  See `lexeme`.
sourceraw docstring

line-cmtclj

(line-cmt beg)

Reads and returns a line comment as specified by the begin marker. Throws an exception if the specified block-comment doesn't occur at the current position.

Reads and returns a line comment as specified by the begin marker.
Throws an exception if the specified block-comment doesn't occur at the
current position.
sourceraw docstring

line-cmt?clj

(line-cmt? beg)

Similar to line-cmt but returns a nil instead of throwing an exception in case of a match failure.

Similar to line-cmt but returns a nil instead of throwing an exception
in case of a match failure.
sourceraw docstring

line-columnclj

(line-column s cursor)

Returns the line and column vector corresponding to the cursor in string s

Returns the line and column vector corresponding to the cursor in string s
sourceraw docstring

line-posclj

(line-pos)
(line-pos cursor)

Returns [line column] vector corresponding to the specified cursor position (or the current position if cursor is not specified) of the parser

Returns [line column] vector corresponding to the specified cursor position (or
the current position if cursor is not specified) of the parser
sourceraw docstring

line-pos-strclj

(line-pos-str)
(line-pos-str cursor)

Returns line position in a descriptive string. If the cursor position is specified, the returned value corresponds to that position. Otherwise, the returned value corresponds to the current position.

Returns line position in a descriptive string. If the cursor position is specified,
the returned value corresponds to that position.  Otherwise, the returned value
corresponds to the current position.
sourceraw docstring

look-aheadclj

(look-ahead la-pf-vec)

Takes a collection of look-ahead-string and parse-function pairs and applies the first parse function that follows the matching look-ahead-string and returns the result, or throws a parse exception if the parse function fails.

If none of the look-ahead strings match the current text, an exception is thrown.

To specify a default parse function, provide an empty string as look-ahead and the default parse function at the end of the argument list.

Args: [la-str-1 parse-fn-1 la-str-2 parse-fn-2 ...]

Takes a collection of look-ahead-string and parse-function pairs and applies
the first parse function that follows the matching look-ahead-string  and
returns the result, or throws a parse exception if the parse function fails.

If none of the look-ahead strings match the current text, an exception is thrown.

To specify a default parse function, provide an empty string as look-ahead and
the default parse function at the end of the argument list.

Args: [la-str-1 parse-fn-1 la-str-2 parse-fn-2 ...]
sourceraw docstring

look-ahead*clj

(look-ahead* la-pf-vec)

Same as look-ahead, but consumes the matching look-ahead string before applying the corresponding parse function.

Same as look-ahead, but consumes the matching look-ahead string before
applying the corresponding parse function. 
sourceraw docstring

mark-posclj

(mark-pos)

Returns the current positional parameters of the parser.

Returns the current positional parameters of the parser.
sourceraw docstring

multi*clj

(multi* parse-fn)

Matches zero or more occurrences of text accepted by the provided parse function and returns the results in a vector.

Matches zero or more occurrences of text accepted by the provided parse 
function and returns the results in a vector.
sourceraw docstring

multi*_cljmacro

(multi*_ parse-expr)

Creates and returns a parse function that calls multi* when it is invoked. The argument parse-expr is converted to a parse function and passed to multi* in the returned function's body. See multi*.

Creates and returns a parse function that calls `multi*` when it is
invoked. The argument `parse-expr` is converted to a parse function
and passed to `multi*` in the returned function's body.  See `multi*`.
sourceraw docstring

multi+clj

(multi+ parse-fn)

Matches one or more occurrences of text accepted by the provided parse function and returns the results in a vector. If the parse function doesn't match even once, an exception is thrown.

Matches one or more occurrences of text accepted by the provided parse 
function and returns the results in a vector. If the parse function doesn't 
match even once, an exception is thrown.
sourceraw docstring

multi+_cljmacro

(multi+_ parse-expr)

Creates and returns a parse function that calls multi+ when it is invoked. The argument parse-expr is converted to a parse function and passed to multi+ in the returned function's body. See multi+.

Creates and returns a parse function that calls `multi+` when it is
invoked. The argument `parse-expr` is converted to a parse function
and passed to `multi+` in the returned function's body.  See `multi+`.
sourceraw docstring

next-textclj

(next-text)
source

no-trimclj

(no-trim parse-fn)

Similar to with-trim-off, but takes a function as a parameter instead of the body

Similar to with-trim-off, but takes a function as a parameter instead of
the body
sourceraw docstring

no-trim-nlclj

(no-trim-nl parse-fn)

Turns off automatic trimming of newline characters (as part of white-space) and executes the specified function. The earlier auto-trim options are restored at the end of execution of the specified function.

Turns off automatic trimming of newline characters (as part of white-space)
and executes the specified function. The earlier auto-trim options are restored
at the end of execution of the specified function.
sourceraw docstring

no-trim-nl_cljmacro

(no-trim-nl_ parse-expr)

Creates and returns a parse function that calls no-trim-nl when it is invoked. The argument parse-expr is converted to a parse function and passed to no-trim-nl in the returned function's body. See no-trim-nl.

Creates and returns a parse function that calls `no-trim-nl` when it is
invoked. The argument `parse-expr` is converted to a parse function
and passed to `no-trim-nl` in the returned function's body.  See `no-trim-nl`.
sourceraw docstring

no-trim_cljmacro

(no-trim_ parse-expr)

Creates and returns a parse function that calls no-trim when it is invoked. The argument parse-expr is converted to a parse function and passed to no-trim in the returned function's body. See no-trim.

Creates and returns a parse function that calls `no-trim` when it is
invoked. The argument `parse-expr` is converted to a parse function
and passed to `no-trim` in the returned function's body.  See `no-trim`.
sourceraw docstring

numberclj

(number)

Matches an integral or non-integral numeric value. While the function decimal also matches both integer and non-integer values, it always returns a Double; where as number returns Long for integers and Double for non-integers.

Matches an integral or non-integral numeric value. While the function 
decimal also matches both integer and non-integer values, it always
returns a Double; where as number returns Long for integers and Double
for non-integers.
sourceraw docstring

op-mapclj

(op-map)
source

operatorclj

(operator)
source

optclj

(opt parse-fn)
(opt parse-fn default-val)

Same as attempt, but accepts a default value argument to return in case the specified parse function fails. Useful for matching optional text.

Same as attempt, but accepts a default value argument to return in case the
specified parse function fails.  Useful for matching optional text.
sourceraw docstring

opt_cljmacro

(opt_ parse-expr)
(opt_ parse-expr default-val)

Creates and returns a parse function that calls opt when it is invoked. The argument parse-expr is converted to a parse function and passed to opt in the returned function's body. See opt.

Creates and returns a parse function that calls `opt` when it is
invoked. The argument `parse-expr` is converted to a parse function
and passed to `opt` in the returned function's body.  See `opt`.
sourceraw docstring

paren-exprclj

(paren-expr)
source

parensclj

(parens parse-fn)

Returns the result of applying specifed parse function to text that is in between the opening and closing parentheses '(' and ')'

Returns the result of applying specifed parse function to text that is
in between the opening and closing parentheses '(' and ')'
sourceraw docstring

parseclj

(parse parse-fn input-str & opts)

This function triggers off the parsing of the provided input string using the specified parse function. The following parser options may be provided to alter the default behavior of the parser: :blk-cmt-delim - vector specifying start and end of block-comment markers :line-cmt-start - string specifying the begin marker of a line comment :ws-regex - regular expression for matching (non-comment) white space :auto-trim - whether to automatically remove the leading whitespace/comments at the current position in the input text or immediately after a parse action. :word-regex - regular expression for matching words :operators - a vector of vector of operators in the decreasing order of precedence; see get-default-ops function for an example. :op-fn-map - a map of operator and the function to call for that operator when evaluating expressions :eof - if true, the parse function must consume the entire input text

Args: parse-fn - parse function to apply input-str - input text to be parsed opts - key value options (listed above)

This function triggers off the parsing of the provided input string using
the specified parse function. The following parser options may be provided 
to alter the default behavior of the parser:
:blk-cmt-delim - vector specifying start and end of block-comment markers
:line-cmt-start - string specifying the begin marker of a line comment
:ws-regex - regular expression for matching (non-comment) white space
:auto-trim - whether to automatically remove the leading whitespace/comments
at the current position in the input text or immediately after a parse action.
:word-regex - regular expression for matching words
:operators - a vector of vector of operators in the decreasing order of
precedence; see get-default-ops function for an example.
:op-fn-map - a map of operator and the function to call for that operator when
evaluating expressions
:eof - if true, the parse function must consume the entire input text

Args:
parse-fn  - parse function to apply
input-str - input text to be parsed
opts      - key value options (listed above)
sourceraw docstring

parse_cljmacro

(parse_ parse-expr input-str & opts)

Similar to the parse function, but takes a parse expression instead of a parse function as its first argument. The parse expression is any clojure expression that performs parsing by calling built-in or custom parse functions. See the documentation for parse

Similar to the `parse` function, but takes a parse expression instead of a
parse function as its first argument. The parse expression is any clojure
expression that performs parsing by calling built-in or custom parse
functions. See the documentation for `parse`
sourceraw docstring

parser-initclj

(parser-init input-str)
(parser-init input-str opts)

Initializes the parser state with the specified input string and options.

Initializes the parser state with the specified input string and options.
sourceraw docstring

pcloseclj

(pclose)

Matches and returns a closing paranthesis character

Matches and returns a closing paranthesis character
sourceraw docstring

popenclj

(popen)

Matches and returns an opening paranthesis character

Matches and returns an opening paranthesis character
sourceraw docstring

read-chclj

(read-ch)
(read-ch is-no-auto-trim)

Reads and return the next input character. Throws an exception if the current position is at the end of the input.

Reads and return the next input character. Throws an exception if the
current position is at the end of the input.
sourceraw docstring

read-ch-in-setclj

(read-ch-in-set char-set)
(read-ch-in-set char-set is-no-auto-trim)

Reads and returns the next character if it matches any of the characters specified in the provided set. An exception is thrown otherwise. The optional is-no-auto-trim argument may be used to specify whether or not to apply auto-trim after reading the next character.

Reads and returns the next character if it matches any of the characters
specified in the provided set.  An exception is thrown otherwise.  The
optional is-no-auto-trim argument may be used to specify whether or not
to apply auto-trim after reading the next character.
sourceraw docstring

read-nclj

(read-n n)

Reads and returns an n-character string at the current position.

Reads and returns an n-character string at the current position.
sourceraw docstring

read-reclj

(read-re re)
(read-re re grp)

Reads the string matching the specified regular expression. If a match-group is specified, the corresponding text is returned; otherwise the entire matched text is returned.

Reads the string matching the specified regular expression. If a match-group
is specified, the corresponding text is returned; otherwise the entire 
matched text is returned.
sourceraw docstring

read-toclj

(read-to s)

The parser skips to the position where the text contains the string specified by s. The string itself is not consumed, that is the cursor is positioned at the beginning of the match. If the specified string is not found, cursor position does not change and a parse exception is thrown.

The parser skips to the position where the text contains the string
specified by s. The string itself is not consumed, that is the cursor is
positioned at the beginning of the match. If the specified string is not
found, cursor position does not change and a parse exception is thrown.
sourceraw docstring

read-to-reclj

(read-to-re re)

Reads and returns text upto but not including the text matched by the specified regular expression. If the specified regular expression doesn't occur in the remaining input text, an exception is thrown.

Reads and returns text upto but not including the text matched by the
specified regular expression. If the specified regular expression doesn't
occur in the remaining input text, an exception is thrown.
sourceraw docstring

read-to-re-or-eofclj

(read-to-re-or-eof re)

If the specified regex matches in the remaining text, returns text upto the match; Otherwise returns all the remaining text and the input cursor is positioned at EOF.

If the specified regex matches in the remaining text, returns text upto the match;
Otherwise returns all the remaining text and the input cursor is positioned at EOF.
sourceraw docstring

read-wsclj

(read-ws)

Reads whitespace (including comments) using a whitespace reader based on parser options. If the :ws-reader option is not set, a default whitespace reader based on other parser options such as :ws-regex, :blk-cmt-delim and :line-cmt-start will be used. Returns the whitespace read.

Reads whitespace (including comments) using a whitespace reader based
on parser options. If the :ws-reader option is not set, a default whitespace
reader based on other parser options such as :ws-regex, :blk-cmt-delim and
:line-cmt-start will be used. Returns the whitespace read.
sourceraw docstring

regexclj

(regex re)
(regex re grp)

Returns the text matched by the specified regex; If a group is specified, the returned text is for that group only. In either case, the cursor is advanced by the length of the entire matched text (group 0)

Returns the text matched by the specified regex; If a group is specified,
the returned text is for that group only. In either case, the cursor is
advanced by the length of the entire matched text (group 0)
sourceraw docstring

semiclj

(semi)

Matches and returns a semi-colon character

Matches and returns a semi-colon character
sourceraw docstring

sep-byclj

(sep-by fld-fn fld-sep-fn)
(sep-by fld-fn fld-sep-fn rec-sep-fn)

Reads a record using the specified field, field-separator and record-separator parse functions. If no record-separator is specified, a newline character is used as record separator. Returns the fields of the record in a vector.

Reads a record using the specified field, field-separator and 
record-separator parse functions.  If no record-separator is specified, 
a newline character is used as record separator. Returns the fields of the 
record in a vector.
sourceraw docstring

sep-by*clj

(sep-by* parse-fn sep-fn stop-fn)

Differs from sep-by in that it allows zero matches of parse-fn before stop-fn; Unlike sep-by, stop-fn must match -- not optional.

Differs from sep-by in that it allows zero matches of parse-fn before stop-fn;
Unlike sep-by, stop-fn must match -- not optional.
sourceraw docstring

sep-restclj

(sep-rest parse-fn sep-fn)
source

seriesclj

(series & parse-fns)

Applies a sequence of parse functions and returns their results in a vector. Each successfull match by the parse function advances the cursor. If any of the parse functions fails, an exception is thrown.

Applies a sequence of parse functions and returns their results in
a vector. Each successfull match by the parse function advances the cursor.
If any of the parse functions fails, an exception is thrown.
sourceraw docstring

series_cljmacro

(series_ & parse-exprs)

Creates and returns a parse function that calls series when it is invoked. The arguments parse-exprs are converted to parse functions and passed to series in the returned function's body. See series.

Creates and returns a parse function that calls `series` when it is
invoked. The arguments `parse-exprs` are converted to parse functions
and passed to `series` in the returned function's body.  See `series`.
sourceraw docstring

set-blk-cmt-optsclj

(set-blk-cmt-opts beg end)

Sets block comment begin and end markers.

Sets block comment begin and end markers.
sourceraw docstring

set-line-cmt-optsclj

(set-line-cmt-opts beg)

Sets line comment begin marker.

Sets line comment begin marker.
sourceraw docstring

set-optclj

(set-opt k v)

Sets parser option k to value v

Sets parser option k to value v
sourceraw docstring

set-optsclj

(set-opts opts)

Sets specified parser options

Sets specified parser options
sourceraw docstring

set-ws-readerclj

(set-ws-reader ws-reader)

This sets the white-space parser to be used when auto-trim is set. If this is specified, it overrides the options set by set-blk-cmt-opts, set-line-cmt-opts and set-ws-regex options.

This sets the white-space parser to be used when auto-trim is set.
If this is specified, it overrides the options set by set-blk-cmt-opts,
set-line-cmt-opts and set-ws-regex options.
sourceraw docstring

set-ws-regexclj

(set-ws-regex ws-re)

Sets the regular expression to be used for matching non-comment white-space.

Sets the regular expression to be used for matching non-comment white-space.
sourceraw docstring

skip-overclj

(skip-over s)

Finds the specified string s in the input and skips over it. If the string is not found, a parse exception is thrown.

Finds the specified string s in the input and skips over it. If the string
is not found, a parse exception is thrown.
sourceraw docstring

skip-over-reclj

(skip-over-re re)

Reads and returns text upto and including the text matched by the specified regular expression. If the specified regular expression doesn't occur in the remaining input text, an exception is thrown.

Reads and returns text upto and including the text matched by the
specified regular expression. If the specified regular expression doesn't
occur in the remaining input text, an exception is thrown.
sourceraw docstring

sq-bracketsclj

(sq-brackets parse-fn)

Returns the result of applying specifed parse function to text that is in between the opening and closing square brackets '[' and ']'

Returns the result of applying specifed parse function to text that is
in between the opening and closing square brackets '[' and ']'
sourceraw docstring

sq-strclj

(sq-str)

Parses a single-quoted string and returns the matched string (minus the quotes)

Parses a single-quoted string and returns the matched string (minus the quotes)
sourceraw docstring

sqcloseclj

(sqclose)

Matches and returns a closing curly brace character

Matches and returns a closing curly brace character
sourceraw docstring

sqopenclj

(sqopen)

Matches and returns an opening curly brace character

Matches and returns an opening curly brace character
sourceraw docstring

starts-with-re?clj

(starts-with-re? re)

Returns a boolean value indicating whether the specified regular expression matches the input at the current position.

Returns a boolean value indicating whether the specified regular expression
matches the input at the current position.
sourceraw docstring

starts-with?clj

(starts-with? s)

Returns a boolean value indicating whether the current input text matches the specified string.

Returns a boolean value indicating whether the current input text matches
the specified string.
sourceraw docstring

stateclj

(state)
source

stringclj

(string s)

If the input matches the specified string, the string is returned. Otherwise, a parse exception is thrown.

If the input matches the specified string, the string is
returned. Otherwise, a parse exception is thrown.
sourceraw docstring

string-inclj

(string-in strings)

Returns the longest string from the provided strings that matches text at the current position. Throws an exception if none of the strings match.

Returns the longest string from the provided strings that matches text
at the current position. Throws an exception if none of the strings match.
sourceraw docstring

string-in-ordclj

(string-in-ord strings)

Returns the first string from the provided strings that matches text at the current position. Throws an exception if none of the strings match.

Returns the first string from the provided strings that matches text
at the current position. Throws an exception if none of the strings match.
sourceraw docstring

throw-exclj

(throw-ex)
(throw-ex msg)
(throw-ex msg map)
(throw-ex msg map cause)

Throws an exception of ExceptionInfo class; this is usually called to indicate a match failure in a parse function.

Throws an exception of ExceptionInfo class; this is usually called to 
indicate a match failure in a parse function.
sourceraw docstring

timesclj

(times n parse-fn)

Applies the provided parse function exactly n times and returns the results of applications of the function in a vector.

Applies the provided parse function exactly n times and returns the
results of applications of the function in a vector.
sourceraw docstring

times_cljmacro

(times_ n parse-expr)

Creates and returns a parse function that calls times when it is invoked. The argument parse-expr is converted to a parse function and passed to times in the returned function's body. See times.

Creates and returns a parse function that calls `times` when it is
invoked. The argument `parse-expr` is converted to a parse function
and passed to `times` in the returned function's body.  See `times`.
sourceraw docstring

unexpectedclj

(unexpected expected)
(unexpected actual expected)

Creates a message string for unexpected input exception.

Creates a message string for unexpected input exception.
sourceraw docstring

with-followclj

(with-follow parse-fn follow-fn)

Applies parse-fn and follow-fn in sequence; Ignores the result of follow-fn and returns the result of parse-fn.

Applies parse-fn and follow-fn in sequence; Ignores the result of follow-fn and
returns the result of parse-fn.
sourceraw docstring

with-follow*clj

(with-follow* parse-fn follow-fn)

Similar to with-follow, but commits to follow-fn parse if parse-fn succeeds. Returns the result of parse-fn.

Similar to with-follow, but commits to follow-fn parse if parse-fn succeeds. 
Returns the result of parse-fn.
sourceraw docstring

with-no-followclj

(with-no-follow parse-fn follow-fn)

Applies parse-fn and follow-fn in sequence; This method succeeds only if the follow-fn fails to match. Returns the result of parse-fn.

Applies parse-fn and follow-fn in sequence; This method succeeds only if the 
follow-fn fails to match. Returns the result of parse-fn.
sourceraw docstring

with-optsclj

(with-opts opts parse-fn)
source

with-trim-offcljmacro

(with-trim-off & body)

Executes the provided body with auto-trim option set to false. The earlier value of the auto-trim option is restored after executing the body.

Executes the provided body with auto-trim option set to false.  The earlier
value of the auto-trim option is restored after executing the body.
sourceraw docstring

with-trim-oncljmacro

(with-trim-on & body)

Executes the provided body with auto-trim option set to true. The earlier value of the auto-trim option is restored after executing the body.

Executes the provided body with auto-trim option set to true.  The earlier
value of the auto-trim option is restored after executing the body.
sourceraw docstring

wordclj

(word w)

Returns the specified word if the word occurs at the current position in the input text; an exception is thrown otherwise.

Returns the specified word if the word occurs at the current position in
the input text; an exception is thrown otherwise.
sourceraw docstring

word-inclj

(word-in str-coll)
(word-in str-coll word-reader)

Returns the first word from the provided words that matches text at the current position. Throws an exception if none of the words match. An optional word-reader parse-function may be provided to read words.

Returns the first word from the provided words that matches text
at the current position. Throws an exception if none of the words match.
An optional word-reader parse-function may be provided to read words.
sourceraw docstring

wsclj

(ws)
(ws bcb bce lcb wsre)

Matches white space (including comments) at the current position. The optional parameters bcb, bce, lcb and wsre specify block-comment-begin, block-comment-end, line-comment-begin and white-space-regex respectively. If they are not specified here, the options set for the parser are used. Throws an exception if white space doesn't occur at the current position.

Matches white space (including comments) at the current position.  The
optional parameters bcb, bce, lcb and wsre specify block-comment-begin,
block-comment-end, line-comment-begin and white-space-regex respectively.
If they are not specified here, the options set for the parser are used.
Throws an exception if white space doesn't occur at the current position.
sourceraw docstring

ws?clj

(ws? & args)

Similar to ws except that a nil value is returned instead of throwing an exception in case of a match failure.

Similar to ws except that a nil value is returned instead of throwing
an exception in case of a match failure.
sourceraw docstring

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

× close