[issue2009] Grammar change to prevent shift/reduce problem with varargslist

2010-07-12 Thread Mark Dickinson
Mark Dickinson added the comment: Applied in r82837. I'll open a separate issue for the trailing commas. -- resolution: -> accepted stage: patch review -> committed/rejected status: open -> closed ___ Python tracker

[issue2009] Grammar change to prevent shift/reduce problem with varargslist

2010-07-09 Thread Mark Dickinson
Mark Dickinson added the comment: > Good point - I just wouldn't worry about it in that case. Ah, now I have to apologise: after some discussion on #python-dev IRC, I'm afraid I've (perhaps foolishly) rejected this advice. :) See python-dev discussion starting at http://mail.python.org/pi

[issue2009] Grammar change to prevent shift/reduce problem with varargslist

2010-07-09 Thread Nick Coghlan
Nick Coghlan added the comment: > No,  "def f(*, a,): ..." is still a SyntaxError with the patch.  I'd think > that allowing that extra comma *would* be a violation of the moratorium, > though maybe it's debatable.  Perhaps worth bringing up on python-dev? Good point - I just wouldn't worry a

[issue2009] Grammar change to prevent shift/reduce problem with varargslist

2010-07-09 Thread Mark Dickinson
Mark Dickinson added the comment: No, "def f(*, a,): ..." is still a SyntaxError with the patch. I'd think that allowing that extra comma *would* be a violation of the moratorium, though maybe it's debatable. Perhaps worth bringing up on python-dev? --

[issue2009] Grammar change to prevent shift/reduce problem with varargslist

2010-07-09 Thread Nick Coghlan
Nick Coghlan added the comment: > BTW, I'm a bit surprised that the grammar doesn't allow for trailing commas > after keyword-only arguments:  that is, > > def f(a, b,): ...     is fine, but > def f(*, a, b,): ...  is a SyntaxError That seems more like an oversight than a deliberate restrictio

[issue2009] Grammar change to prevent shift/reduce problem with varargslist

2010-07-09 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a patch. I'm assuming that this doesn't violate the moratorium, since it's not so much a change to the grammar itself as a modification to the way that it's expressed. -- keywords: +patch stage: -> patch review Added file: http://bugs.python.o

[issue2009] Grammar change to prevent shift/reduce problem with varargslist

2010-07-09 Thread Mark Dickinson
Mark Dickinson added the comment: +!. I had to do a very similar refactoring recently when trying to fix the parser module to understand keyword-only arguments and annotations. Taking keyword-only arguments into account, I think the replacement needs to be: varargslist: (vfpdef ['=' test] (',

[issue2009] Grammar change to prevent shift/reduce problem with varargslist

2010-07-08 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- versions: +Python 3.2 -Python 2.6, Python 3.0 ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue2009] Grammar change to prevent shift/reduce problem with varargslist

2008-02-05 Thread Nick Coghlan
Nick Coghlan added the comment: Sorry, I misread slightly (or else just got confused as to which of the 3 Grammar files I was looking at on my local machine). What you've posted already is indeed the relevant change for 2.6 - it's only 3.0 that is slightly different because it allows the definiti

[issue2009] Grammar change to prevent shift/reduce problem with varargslist

2008-02-05 Thread Andrew Dalke
Andrew Dalke added the comment: I've been working from the Grammar file from CVS for 2.6 ... I thought. For example, I see "# except_clause: 'except' [test [('as' | ',') test]]" which is a 2.6-ism. "svn log" says it hasn't changed since 2007-05-19, when except/as was added. What did I miss?

[issue2009] Grammar change to prevent shift/reduce problem with varargslist

2008-02-05 Thread Nick Coghlan
Nick Coghlan added the comment: I don't have any objection in principle, but I would like to see the updated rules based on the 2.6 and 3.0 Grammar files (they should only be minor variants of what you have already done for 2.5) __ Tracker <[EMAIL PROTECTED]>

[issue2009] Grammar change to prevent shift/reduce problem with varargslist

2008-02-04 Thread Christian Heimes
Changes by Christian Heimes: -- components: +Interpreter Core -None nosy: +ncoghlan, nnorwitz priority: -> normal versions: +Python 2.6, Python 3.0 __ Tracker <[EMAIL PROTECTED]> __ _

[issue2009] Grammar change to prevent shift/reduce problem with varargslist

2008-02-04 Thread Andrew Dalke
New submission from Andrew Dalke: I wrote a translator from the CFG used in the Grammar file into a form for PLY. I found one problem with varargslist: ((fpdef ['=' test] ',')* ('*' NAME [',' '**' NAME] | '**' NAME) | fpdef ['=' test] (',' fpdef ['=' test])* [','])