2013/6/28 Pynix Wang <pynix.wang at gmail.com> > I want use coffeescript function syntax to write python lambda expression > so I modified the Grammar file. > > ``` > atom: ('(' [yield_expr|testlist_comp|vararglist] ')' | > '[' [testlist_comp] ']' | > '{' [dictorsetmaker] '}' | > NAME | NUMBER | STRING+ | '...' | 'None' | 'True' | 'False') > trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME | '->' text > ``` > > but when I write > ``` > (x,y=1)->x+y > ``` > the parser doesn't go into vararglist. > This grammar is not LL(1) anymore (it's probably LALR now) when seeing "x", it has the choice between testlist_comp and vararglist, and the first one is picked. Python's parser generator only supports LL(1) grammars. -- Amaury Forgeot d'Arc -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20130628/a191a82a/attachment.html>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4