Crate HOLP
Source - State
- Testree
- any
- Attempts several parsers.
Returns true if at least one succeeds.
- attempt
- Applies optional parsers in sequence.
Returns the first that succeeds.
If none succeeds, aborts.
- do_force_there_take_exact
- Monadic
force_there_take_exact
. - do_here_end
- Monadic
here_end
. - do_here_peek_exact
- Monadic ‘here_take_exact’.
- do_here_peek_head
- Monadic here_peek_head.
- do_here_take_exact
- Monadic ‘here_take_exact’.
- do_here_take_head
- Monadic here_take_head.
- do_skip
- Monadic skip.
- do_skip_comment
- Monadic skip_comment.
- do_skip_spaces
- Monadic skip_spaces.
- do_there_end
- Monadic
there_end
. - do_there_peek_exact
- Monadic ‘there_peek_exact’.
- do_there_peek_head
- Monadic peek_symol.
- do_there_take_exact
- Monadic ‘there_take_exact’.
- do_there_take_head
- Monadic there_take_head.
- dry
- Evaluates a parser and returns its result, but reverts its effect.
- expected
- find
- force_there_take_exact
- Perform
there_take_exact
. Abort if not possible. - guard
- Checks if a dry-run of the first parser returns
true
.
If so, applies the second parser and returns Some
.
If no, returns None
. - head
- Maybe gets the current character.
- here_end
- Returns
true
if cursor will be at the end of the file. - here_name
- Parses a name right after the parsing cursor.
- here_peek_exact
- Attempts to match a string right after the cursor.
Returns
true
if successful. Doesn’t consume it. - here_peek_head
- Returns, without consuming, the next char, or ‘\0’.
- here_take_exact
- Attempts to match a string right after the cursor.
Returns
true
if successful. Consumes string. - here_take_head
- Returns and consumes the next char, or ‘\0’.
- leaf_parser
- list
- Evaluates a list-like parser, with an opener, separator, and closer.
- maybe
- Takes a parser that can abort, and transforms it into a non abortive parser
that returns Some if it succeeds, and None if it fails.
- node_parser
- read
- skip
- Skips comments and whitespace.
- skip_comment
- Skips C-like comments, starting with ‘//’.
- skip_spaces
- Skips whitespaces.
- skip_while
- Skips characters until a condition is false.
- tail
- Skips the current character.
- testree_parser
- testree_show
- there_end
- Skip, then
here_end
. - there_name
- Parses a name after skipping comments and whitespace.
- there_nonempty_name
- Parses a non-empty name after skipping.
- there_peek_exact
- Skip, then ‘here_peek_exact’.
- there_peek_head
- Skip, then here_peek_head.
- there_take_exact
- Skip, then ‘here_take_exact’.
- there_take_head
- Skip, then here_take_head.
- until
- Evaluates a parser until a condition is met. Returns an array of results.
- Answer
- Parser