Header lexy/dsl/any.hpp

Token rule lexy::dsl::any

lexy/dsl/any.hpp
namespace lexy::dsl
{
    constexpr token-rule auto any;
}

any is a token rule that matches anything.

Matching

Consumes the entire input. If the rule is matched in a context where the reader has been artificially delimited, consumes only until the end of the partial input is reached.

Errors

None.

Parse tree

Single token node with the lexy::predefined_token_kind  lexy::any_token_kind.

Example 1. Match literally any input
struct production
{
    static constexpr auto rule = dsl::any;
};
Caution
any does not care what input it consumes; it can be anything, including ill-formed Unicode. To restrict the input that is consumed, use lexy::dsl::while_  instead.

See also