parrt/antlr4 — pull request #99 by sharwell (2012-10-15 03:52:44+00:00)
Title: Updated handling of non-greedy decisions in the lexer

With this patch, non-greedy blocks in the lexer behave like regular expressions: shortest sequence that still produces a valid match is used. Rules in the lexer are still ordered, but all other decisions within lexer rules themselves are unordered for optimal performance.

This algorithm produces consistent greedy/non-greedy behavior for `()?`, `()*`, and `()+`, and does not lead to surprises like previously seen in `testWildcardQuirk`.