Commit graph

4 commits

Author SHA1 Message Date
Thomas Wouters dca3b9c797 PEP 308 implementation, including minor refdocs and some testcases. It
breaks the parser module, because it adds the if/else construct as well as
two new grammar rules for backward compatibility. If no one else fixes
parsermodule, I guess I'll go ahead and fix it later this week.

The TeX code was checked with texcheck.py, but not rendered. There is
actually a slight incompatibility:

>>> (x for x in lambda:0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: iteration over non-sequence

changes into

>>> (x for x in lambda: 0)
  File "<stdin>", line 1
    (x for x in lambda: 0)
                     ^
SyntaxError: invalid syntax

Since there's no way the former version can be useful, it's probably a
bugfix ;)
2006-02-27 00:24:13 +00:00
Jeremy Hylton c960f26044 Improved handling of syntax errors.
Expand set of errors caught in set_context().  Some new errors, some
old error messages changed for consistency.

Fixed error checking in generator expression code.  The first set of
tests were impossible condition given the grammar.  In general, the
ast code uses REQ() for those sanity checks.

Fix some error handling for augmented assignments.  As comments in the
code explain, set_context() ought to work here, but I got unexpected
crashes when I tried it.  Should come back to this.

Add note to Grammar that yield expression is a special case.

Add doctest cases for SyntaxErrors raised by ast.c.
2006-01-27 15:18:39 +00:00
Neal Norwitz 19b0f40cb1 Thou shalt not lie, there are really 5 types now 2005-11-15 04:52:16 +00:00
Jeremy Hylton 3e0055f8c6 Merge ast-branch to head
This change implements a new bytecode compiler, based on a
transformation of the parse tree to an abstract syntax defined in
Parser/Python.asdl.

The compiler implementation is not complete, but it is in stable
enough shape to run the entire test suite excepting two disabled
tests.
2005-10-20 19:59:25 +00:00