<div dir="ltr">2013/6/28 Pynix Wang <span dir="ltr"><<a href="mailto:pynix.wang@gmail.com" target="_blank">pynix.wang@gmail.com</a>></span><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">I want use coffeescript function syntax to write python lambda expression so I modified the Grammar file.<div><br></div><div>```</div><div><div>atom: ('(' [yield_expr|testlist_comp|vararglist] ')' |</div>

<div>       '[' [testlist_comp] ']' |</div><div>       '{' [dictorsetmaker] '}' |</div><div>       NAME | NUMBER | STRING+ | '...' | 'None' | 'True' | 'False')</div>

<div>trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME | '->' text<br></div><div>```</div><div><br></div><div>but when I write</div><div>```</div>
<div>(x,y=1)->x+y</div><div>```</div><div>the parser doesn't go into vararglist.</div></div></div></blockquote><div><br></div><div>This grammar is not LL(1) anymore (it's probably LALR now)<br></div><div>when seeing "x", it has the choice between testlist_comp and vararglist,</div>
<div>and the first one is picked.</div><div>Python's parser generator only supports LL(1) grammars.</div></div><div><br></div>-- <br>Amaury Forgeot d'Arc
</div></div>