Hi, On Wed, 19 Jan 2011, Paul Eggert wrote:
> On 01/19/2011 12:13 AM, Alex Rozenman wrote: > > it is impossible to obtain an unambiguous grammar with syntax extensions > > like id '[' c_id ']' without involving the ';' requirement. > > Yes, but that's OK; that's what I'm proposing. That is, I'm proposing that > if a user wants to use the new syntax extensions, the user also must put ';' > at the end of each rule. > > It's OK to require ';' for new grammars. Omitting ';' has been deprecated > for many years, and no new grammars should be omitting ';'. I also agree that the code here is hard to read and that something should be done eventually. However, unless there's a bug, can we postpone this work until after the 2.5 release? Named references are experimental, and omitting semicolons is deprecated, so I don't see any pressing need to address this now. I feel it would be more beneficial to spend our scarce time on the problems already raised in this thread. Also, as you probably recall, the reason scan-gram.l has to be so messy in order to support omitting semicolons is because Bison-generated parsers support only one token of lookahead. However, after 2.5, I'd like to propose a mechanism that enables a user to cleanly extend lookahead at particular points in a grammar. About a year ago, I implemented that mechanism offline and successfully used it to clean up this area of the grammar without changing the functionality. So, whenever we return to this issue, if we find that there's no other nice way to clean up this code without losing important backward compatibility, we'll still have a decent way out.