defined.
alias or!(literal!("abc"), charRange!('0','9')) rule; alias named!(rule, "myRule") myRule; auto input = "abc3"; auto p1 = rule(input); auto p2 = myRule(input); // They are both successful assert(p1.successful && p2.successful); assert(p1.matches == p2.matches); // But the names are different assert(p1.name == `or!(literal!("abc"), charRange!('0','9'))`); assert(p2.name == `myRule`); // Same children: assert(p2.children == p1.children);
Internal helper template, to get a parse tree node with a name. For example, given:
myRule gives nodes named "or", since its the parent rule. If you want nodes to be named "myRule", use named. named just overwrites the original root node name, the children are left untouched.