Avoid stack overflow in the Smalltalk parser.
Updated 1 year, 9 months ago
| Truls Becken | Reviewers | ||
| EtoileCore | |||
| None | Etoile trunk (etoile/trunk/Etoile) | ||
In order to make STOP a separator rather than terminator, the parser rules for statement_list and expression_list were written right-recursive. This made the parser stack grow with no fixed limit, and thus gave a stack overflow if a method was long/complex enough. The argument_list was written in a similar way. This is now avoided by adding a layer which dispatches between including or leaving out the last STOP. This also eliminates the ugly-ish addObject:atIndex:0 code for building an array backwards.