Parselix v0.4.0 Parselix.Basic

Provide basic parsers.

Summary

Functions

Parses any character

Parses a specified character

Validates the result of the given parser

Returns a result of the given parser which succeeds first

Removes :empty from the result of the given parser

Concatenates the result of the given parser to a string

Returns a default value when parser failed

Dumps the result of the given parser

Parses the end of text

Replaces error messages

Flattens the result of the given parser

Flattens the result of the given parser once

Ignores the result of the given parser

Parses 0 or more times

Parses 1 or more times

Maps the result of the given parser

Attaches a meta data to the result of the given parser

Parses a not specified character

Parses 0 times or once

Picks one value from the result of the given parser

Parses a string which matches against the given regex

Replaces the result of the given parser

Parses in sequence

Slices the result of the given parser

Parses a specified string

Parses X times

Puts the value out of the result of the given parser

Recursively puts the value out of the result of the given parser

Puts the result of the given parser into an empty array

Functions

any()

Parses any character.

char(option)

Parses a specified character.

check(parser, func)

Validates the result of the given parser.

choice(list)

Returns a result of the given parser which succeeds first.

clean(parser)

Removes :empty from the result of the given parser.

concat(parser)

Concatenates the result of the given parser to a string.

default(parser, default)

Returns a default value when parser failed.

dump(parser)

Dumps the result of the given parser.

eof()

Parses the end of text.

error_message(parser, message)

Replaces error messages.

flat(parser)

Flattens the result of the given parser.

flat_once(parser)

Flattens the result of the given parser once.

ignore(parser)

Ignores the result of the given parser.

many(parser, arg)

Parses 0 or more times.

many(parser, min \\ 0, max \\ -1)
many_1(option)

Parses 1 or more times.

map(parser, func)

Maps the result of the given parser.

meta(parser)

Attaches a meta data to the result of the given parser.

meta(parser, label)
not_char(option)

Parses a not specified character.

option(option)

Parses 0 times or once.

pick(parser, index)

Picks one value from the result of the given parser.

regex(regex)

Parses a string which matches against the given regex.

replace(parser, replacement)

Replaces the result of the given parser.

sequence(list)

Parses in sequence.

slice(parser, range)

Slices the result of the given parser.

slice(parser, start, count)
string(option)

Parses a specified string.

times(parser, time)

Parses X times.

unwrap(parser)

Puts the value out of the result of the given parser.

unwrap_r(parser)

Recursively puts the value out of the result of the given parser.

wrap(parser)

Puts the result of the given parser into an empty array.