[][src]Crate lip

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

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.

Trailing

What’s the deal with trailing commas? Are they Forbidden? Are they Optional? Are they Mandatory?

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.

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.

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.

optional

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

problem

Indicate that a parser has reached a dead end.

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.