When the parser reaches an end state and there’s still more input, it restarts at the starting parse state. I guess it would be reasonable to insert an error node where it does that. What were you trying to do that requires the error node? Or did you just notice that this looked surprising?
Thanks. This just looked surprising in general. I would, at least, expect more than one parse tree in this case, or, yes, an error node. Otherwise, how can I tell that the input is correct? Or maybe there is another API that I can use which does not restart the parser?