optional

Optionally matches p

Return data type will be a Nullable of p's data type

@safe
struct optional () {}

Members

Static functions

opCall
auto opCall(R i)
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

import sdpc.parsers;

auto i = "asdf";
auto r6 = optional!(token!"x")(i);
assert(r6.ok);
assert(r6.v.isNull);

auto r7 = optional!(token!"a")(i);
assert(r7.ok);
assert(!r7.v.isNull);

Meta