Example:
start = name / invocation;
name = [a-zA-Z]+ { return text() };
invocation = a:name "()" { return {type: 'inv', value: a } };
If input is abc()
I am getting error:
Expected [a-zA-Z] or end of input but "(" found
However, if start was defined as follows no issues arise:
start = invocation / name;
For the earlier case, shouldn't the name rule not match and consequently enter the invocation rule? Else how to manage such a thing?
For working example, see playground