[Python-Dev] bug in grammar

Guido van Rossum guido@digicool.com
Thu, 18 Jan 2001 20:06:23 -0500

> I think there should be a well-formedness pass in-between. I.e. after
> the AST has been build, a single pass should descend through the tree,
> looking for an expr_statement with more than a single testlist. Once
> it finds one, it should confirm that this really is a well-formed
> lvalue (in C speak). In this case, the test should be that each term
> is a an atom without factors.

Good ideal.

> If the parser itself performs such checks, the compiler could be
> simplified in many places, I guess.

Not sure that in practice it makes much of a difference: there aren't
that many of these kinds of checks, and writing a separate pass is
expensive.  On the other hand, Jeremy is just writing a separate pass
anyway, to collect name usage information for the nested scopes.
Maybe it could be folded into that pass...

--Guido van Rossum (home page: http://www.python.org/~guido/)