[][src]Crate lip

Lip Parsing Library

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

Macros

chain

Chain several parsers together and parse them in sequence.

one_of

Parse one of many things.

Structs

BoxedParser

Box Parser trait so its size is decidable in compile time.

Located

Add location information to any type.

Location

Records the location of a character within the source string.

Enums

ParseResult

Records the result of the parser.

Traits

Parser

Functions

chomp_if

Chomp one character if it passes the test.

chomp_while0

Chomp zero or more characters if they pass the test.

chomp_while1

Chomp one or more characters if they pass the test.

display_error

Pretty print the error.

either

Choose either the left parser or the right parser to parse.

float

Parses a floating point number, excluding the sign in front.

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.

left

Run the left parser, then the right, last keep the left result and discard the right.

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_char

Parse a single newline character.

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.

optional

Optionally parse something. Returns supplied default value if parse failed.

pair

Pair up two parsers. Run the left parser, then the right, and last combine both outputs into a tuple.

right

Run the left parser, then the right, last keep the right result and discard the left.

space0

Parse zero or more space characters.

space1

Parse one or more space characters.

space_char

Parse a single space character.

take_chomped

Take the chomped string from a bunch of chompers.

token

Parse a given token string.

variable

Parse a variable.

wrap

Wrap a parser with two other delimiter parsers

zero_or_more

Run the parser zero or more times and combine each output into a vector of outputs.