pegjs/pegjs — pull request #307 by Mingun (2014-12-12 18:17:28+00:00)
Title: Bullet-proof report left recursion

How it works: main idea in what for `sequence` it is insufficiently simple to check the first element of sequence because exist cases described in #190, that also have left recursion. Grammars
```
S = a? S
S = a* S
```
it is possible to present in the equivalent form
```
S = S / a S
S = S / a + S
```
As you see, that is classical left recursion. In general, any production, which doesn't consume an input, can lead to the left recursion.

Therefore, if we walk through AST of the rule and we will consume the smallest theoretically possible input, we will be able to define, whether it can lead to the left recursion. We need check all `sequence` elements while one not consume some input. After that any left recursion is inpossible. So, main advantages in checking not only first element of `sequence` node, but all, while some input won't be consumed.