transform_err

Apply func to the error returned by the Parser

Similar to transform, but operates on error instead of data

struct transform_err (
Parser
alias func
) {}

Members

Static functions

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

Examples

struct A {
	int a;
}
struct B {
	int b;
}
struct test01 {
	static auto opCall(R)(R t) if (isForwardRange!R) {
		return ParseResult!(R, A)(t, A(1));
	}
}

alias test02 = transform!(test01, x => B(x.a+1));
auto res = test02("asdf");
static assert(isParser!test01);
static assert(isParser!test02);
static assert(is(typeof(res).DataType == B));

Meta