| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
still has errors from the casts of asdl_seq_GET to cmpop_ty, but
otherwise it's C++ clean.
|
|
|
|
|
| |
entirely happy with the two new VISIT macros in compile.c, but I
couldn't see a better approach.
|
| |
|
| |
|
|
|
|
| |
Re-enable all the tests in test_trace.py except one. Still not sure that these tests test what they used to test, but they pass. One failing test seems to be caused by undocumented line number table behavior in Python 2.4.
|
| |
|
|
|
|
| |
Reorder compiler_set_lineno() call for consistency.
|
| |
|
|
|
|
| |
continue to be handled correctly
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Add it back.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Much of the peephole optimizer is now indented badly, but it's about
to be revised anyway.
|
|
|
|
|
| |
in multiple places. This makes compile()/eval()/etc also inherit the
absolute-import codeflag, like division and with-statement already were.
|
|
|
|
| |
Neal.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- IMPORT_NAME takes an extra argument from the stack: the relativeness of
the import. Only passed to __import__ when it's not -1.
- __import__() takes an optional 5th argument for the same thing; it
__defaults to -1 (old semantics: try relative, then absolute)
- 'from . import name' imports name (be it module or regular attribute)
from the current module's *package*. Likewise, 'from .module import name'
will import name from a sibling to the current module.
- Importing from outside a package is not allowed; 'from . import sys' in a
toplevel module will not work, nor will 'from .. import sys' in a
(single-level) package.
- 'from __future__ import absolute_import' will turn on the new semantics
for import and from-import: imports will be absolute, except for
from-import with dots.
Includes tests for regular imports and importhooks, parser changes and a
NEWS item, but no compiler-package changes or documentation changes.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 ;)
|
| |
|
|
|
|
| |
variables
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This code generated a C assertion:
assert 1, ([s for s in x] +
[s for s in x])
pass
assert was completely broken, it needed to use the proper block.
compiler_use_block() is now no longer used, so remove it.
|
| |
|
| |
|
|
|
|
| |
simplifies a lot of error handling code, and fixes many memory leaks.
|
| |
|
| |
|
|
|
|
|
| |
Document more info about the benefits of configuring without
pymalloc when running valgrind
|
|
|
|
|
|
| |
Also converted a bunch of assert(0) to SystemError's.
There are still printfs, etc that need to be cleaned up.
|
|
|
|
| |
with symtable.c
|
|
|
|
|
|
| |
(Call symtable_exit_block or compiler_exit_scope as appropriate)
Use PyMem_Free on c_future since it was allocated with PyMem_Malloc
|
| |
|
|
|
|
|
| |
allocated by compiler_enter_scope(). Change return type for
compiler_exit_scope() to be void.
|
| |
|
|
|
|
| |
fixing problems with EXTENDED_ARG
|
| |
|
|
|
|
| |
the scope of names can be correctly determined.
|
| |
|
|
|
|
|
| |
historically been looked up using LOAD_NAME, not LOAD_GLOBAL.
looked up by LOAD_NAME, not
|
|
|
|
| |
part. Fixes one bug from #1333982.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
method still needs to support string exceptions, and allow None for the
third argument. Documentation updates are needed, too.
|