I haven't thought about this particularly hard (I just tested simple
cases) but does:
def p_statements(p):
"""statements : statements COMMA statement
| statements COMMA
| statement
"""
if len(p) == 2:
p[0] = [p[1]]
elif len(p) == 3:
p[0] = p[1]
else:
p[0] = p[1] + [p[3]]
Help?
Schiavo
Simon
Yeah that's what I was going to do, but I was wondering if there was a
generic way to handle this case, because I am going to have to add it
in many statements.
Thanks
>
> Schiavo
> Simon
>
> --
> You received this message because you are subscribed to the Google Groups "ply-hack" group.
> To post to this group, send email to ply-...@googlegroups.com.
> To unsubscribe from this group, send email to ply-hack+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ply-hack?hl=en.
>
>
--
Tarek Ziadé | http://ziade.org
You could add an empty statenment, except that would allow "foo,,,"
Albert
good idea, I'll try this
Thanks
>
> Albert