erezsh/plyplus — pull request #9 by muggenhor (2013-07-31 17:30:43+00:00)
Title: Expand recursive @rules in-place to significantly reduce tree-depth

When running with debug=True PLY uses `repr()` on the produced symbols. STree's `repr`
implementation is recursive. As a result when parsing lists of the forms shown below the
recursion depth can easily become to deep causing `RuntimeError`s due to stack overflow.

This commit prevents building lists recursively *if* the `@` EXPAND operator is used on
its production rule.

@list: item
| list item
;
list: item* ;
list: item+ ;