Commit Graph

197 Commits

Author SHA1 Message Date
Neal Norwitz
b902f4e401 Use absolute imports 2006-04-03 04:45:34 +00:00
Nick Coghlan
cb35b95f86 Teach the compiler module about augmented assignment to tuple subscripts 2006-03-14 13:21:14 +00:00
Guido van Rossum
f669436189 Um, I thought I'd already checked this in.
Anyway, this is the changes to the with-statement
so that __exit__ must return a true value in order
for a pending exception to be ignored.
The PEP (343) is already updated.
2006-03-10 02:28:35 +00:00
Tim Peters
39e11fb104 Whitespace normalization. 2006-03-04 02:43:44 +00:00
Neal Norwitz
10be2ea85d SF bug 1442442: LIST_APPEND optimization got lost in the AST merge.
Add it back.
2006-03-03 20:29:11 +00:00
Neal Norwitz
d4e3035701 Fix compiler breakage related to absolute imports 2006-03-03 20:21:48 +00:00
Neal Norwitz
eaed39f303 Hopefully this removes all vestiges of CO_GENERATOR_ALLOWED that can
be removed in 2.x.
2006-03-03 19:12:58 +00:00
Thomas Wouters
fa0cf4f3ae Add support for absolute/relative imports and if/else expressions:
- regenerate ast.py
 - add future flags for absolute-import and with-statement so they
   (hopefully) properly get set in code-object flags
 - try out if/else expressions in actual code for the hell of it.

Seems to generate the same kind of bytecode as the normal compiler.
2006-03-03 18:16:20 +00:00
Guido van Rossum
5bde08dba3 Fix failure of test_compiler.py when compiling test_contextlib.py.
The culprit was an expression-less yield -- the first apparently in
the standard library.  I added a unit test for this.
Also removed the hack to force compilation of test_with.py.
2006-03-02 04:24:01 +00:00
Thomas Wouters
34aa7ba114 from __future__ import with_statement addon for 'with', mostly written by
Neal.
2006-02-28 19:02:24 +00:00
Tim Peters
710ab3b5f8 Whitespace normalization. 2006-02-28 18:30:36 +00:00
Guido van Rossum
baf3eb2410 Forgot to explain the effect of the new opcode.
Sigh -- we really should have one place for all opcode metadata.
2006-02-28 00:40:16 +00:00
Guido van Rossum
7ad94f011e Update the compiler package to compile the with-statement.
Jeremy, please review!
2006-02-28 00:32:16 +00:00
Guido van Rossum
c2e20744b2 PEP 343 -- the with-statement.
This was started by Mike Bland and completed by Guido
(with help from Neal).

This still needs a __future__ statement added;
Thomas is working on Michael's patch for that aspect.

There's a small amount of code cleanup and refactoring
in ast.c, compile.c and ceval.c (I fixed the lltrace
behavior when EXT_POP is used -- however I had to make
lltrace a static global).
2006-02-27 22:32:47 +00:00
Martin v. Löwis
59977a677c Make or_test similar to test, not testlist. 2006-02-27 19:57:01 +00:00
Martin v. Löwis
415ed937c2 Skip over doc strings. 2006-02-27 19:56:30 +00:00
Martin v. Löwis
16c7f71380 Handle testlist_safe and or_test like testlist. 2006-02-27 16:11:03 +00:00
Martin v. Löwis
49a1302952 Alias non-terminals introduced for backwards compatibility. 2006-02-27 16:03:39 +00:00
Neal Norwitz
212a575242 Remove unused _callers member. No need for types, use isinstance 2005-11-25 03:19:29 +00:00
Neal Norwitz
ef260c0803 Stop looping to do nothing, just pass. 2005-11-25 03:18:58 +00:00
Neal Norwitz
d752f7d8e8 No need for types, use isinstance 2005-11-25 03:17:59 +00:00
Neal Norwitz
f9232678ae Use sorted() builtin 2005-11-25 03:16:34 +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
Phillip J. Eby
0d6615fd29 PEP 342 implementation. Per Guido's comments, the generator throw()
method still needs to support string exceptions, and allow None for the
third argument.  Documentation updates are needed, too.
2005-08-02 00:46:46 +00:00
Georg Brandl
f0af0e7a46 patch [ 1231538 ] Typo fix in compiler/transformer.py (WalkerEror) 2005-07-02 18:37:41 +00:00