hylkevds No worry about quick replies, I worked around it with a SCAN.
That shouldn't be necessary any more, at least against the latest build. It should be fixed. You can check out the code and build, of course, but here is a link to a prebuilt jar.
The "Scanning to the end" happens in the if (nextTokenType() == A) { call, so it also happens when parsing is successful.
Ah, yes, I see. I was only thinking about the case when you are actually parsing, not in a lookahead. It is possible that if you lookahead in that case, and it rolls up an InvalidToken for all the characters that it can't lex in that lexical state, then it could be scanning forward a lot of characters! Probably not a very common situation, but it is conceivable. And it is true that, in terms of a lookahead failing, all it needs is to find one invalid character and the lookahead can fail, so it is potentially inefficient. Well, it's something to bear in mind, but it is probably not such a common problem.
Anyway, do let me know if there is any issue with the latest version.