I noticed that the YARD operator 'seq' is a binary operator. Declaring big sequences becomes problematic due to nesting. For example, sequencing ten elements is:
seq<A, seq<B, seq<C, seq<D, seq<E, seq<F, seq<G, seq<H, seq<I, J>>>>>>>>>
I suggest that YARD binary operations are converted to operators with multiple parameters which default to some class that statically evaluates to true, thus allowing for the above sequence to be expressed like this:
seq<A, B, C, D, E, F, G, H, I, J>
The class 'seq' could be declared like this:
template <class T1, class T2, class T3 = True, class T4 = True, ... , class T10 = True> class seq;
and the 'parse' function could use operator &&
so as that the functions that return true are removed by the compiler when optimizations are turned on:
static bool parse() {
return T1::parse() && T2::parse() && T3::parse() && ... && T10::parse();
}
The same can be applied to the choice operator.