Liquex.Parser.Literal (liquex v0.14.0)

Copy Markdown View Source

Helper parsers for parsing literal values in Liquid

Summary

Functions

Parses not line breaking white space, given a minimum.

Parses a single or double quoted string.

Parses everything outside of the Liquid tags. We call this text but it's any unstructed data not specifically parsed by Liquex.

Parses white space, given a minimum.

Functions

literal(combinator \\ empty())

@spec literal(NimbleParsec.t()) :: NimbleParsec.t()

Parses a literal

Examples

* "true"
* "false"
* "nil"
* "3.14"
* "3"
* "'Hello World!'"
* ""Hello World!""

non_breaking_whitespace(combinator \\ empty(), min \\ 0)

@spec non_breaking_whitespace(NimbleParsec.t(), non_neg_integer()) :: NimbleParsec.t()

Parses not line breaking white space, given a minimum.

Examples

* "  "
* " "

quoted_string()

Parses a single or double quoted string.

Strings may have escaped quotes within them.

Examples

Examples here include the quotes as given, as opposed to other examples.

* "Hello World"
* 'Hello World'
* "Hello "World""
* 'Hello "World"'
* 'Hello 'World''

range(combinator \\ empty())

@spec range(NimbleParsec.t()) :: NimbleParsec.t()

Parses a range

Examples

* "(1..5)"
* "(1..num)"

text(combinator \\ empty())

@spec text(NimbleParsec.t()) :: NimbleParsec.t()

Parses everything outside of the Liquid tags. We call this text but it's any unstructed data not specifically parsed by Liquex.

whitespace(combinator \\ empty(), min \\ 0)

@spec whitespace(NimbleParsec.t(), non_neg_integer()) :: NimbleParsec.t()

Parses white space, given a minimum.

Examples

* "  "
* "
"