Crate lip

Source
Expand description

§Lip Parsing Library

Lip provides powerful parser combinators for you to create reusable and flexible parsers.

Macros§

one_of
Parse one of many things.
succeed
A parser that succeeds without chomping any characters.

Structs§

AndThen
Backtrackable
End
FnParser
Ignore
Keep
Located
Add location information to any type.
Location
Records the location of a character within the source string.
Map
MapErr
MapWithState
ParseErr
ParseOk
Pred
Skip
Update
UpdateState

Enums§

OneOfThree
OneOfTwo
ParseResult
Records the result of the parser.
Trailing
What’s the deal with trailing commas? Are they Forbidden? Are they Optional? Are they Mandatory?

Traits§

Parser

Functions§

chomp_if
Chomp one grapheme if it passes the test.
chomp_ifc
Chomp one character if it passes the test.
chomp_while0
Chomp zero or more graphemes if they pass the test.
chomp_while0c
Chomp zero or more characters if they pass the test.
chomp_while1
Chomp one or more graphemes if they pass the test.
chomp_while1c
Chomp one or more characters if they pass the test.
display_error
Pretty print the error.
float
Parses a floating point number, excluding the sign in front.
fn_parser
indent
Parse an indentation specified the number of spaces.
indents
Parse a given number of indentations specified the number of spaces.
int
Parses a decimal integer, excluding the sign in front.
line_comment
Parse a line comment started with comment_symbol.
located
Record the beginning and ending location of the thing being parsed.
newline0
Parsers zero or more newline characters, each with indentations in front.
newline1
Parsers one or more newline characters, each with indentations in front.
newline_with_comment
Parse a newline that maybe preceeded by a comment started with comment_symbol.
one_or_more
Run the parser one or more times and combine each output into a vector of outputs.
one_or_more_until
Run the parser one or more times until an end delimiter (or end of input) and combine each output into a vector of outputs.
optional
Optionally parse something.
optional_with_default
Optionally parse something. Returns supplied default value if parse failed.
problem
Indicate that a parser has reached a dead end.
repeat
Repeat a parser n times
sequence
Parse a sequence like lists or code blocks.
space0
Parse zero or more space characters.
space1
Parse one or more space characters.
take_chomped
Take the chomped string from a bunch of chompers.
token
Parse a given token string.
variable
Parse a variable.
zero_or_more
Run the parser zero or more times and combine each output into a vector of outputs.
zero_or_more_until
Run the parser zero or more times until an end delimiter (or end of input) and combine each output into a vector of outputs.

Type Aliases§

BoxedParser
StdParseResult