| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Note that ast.c still has a mix of tabs and spaces, because it
attempts to use four-space indents for more of the new code.
|
|
|
|
| |
Reported by Mike Verdone.
|
|
|
|
|
| |
Move assembler structure next to assembler code to make it easier to
move it to a separate file.
|
| |
|
|
|
|
|
|
|
| |
It seems like this should be a different error than SystemError, but
I don't have any great ideas and SystemError was raised in 2.4 and earlier.
Will backport.
|
|
|
|
|
|
|
|
| |
The compiler was checking that there was something on the fblock
stack, but not that there was a loop on the stack. Fixed that and
added a test for the specific syntax error.
Bug fix candidate.
|
|
|
|
|
|
| |
I'm undecided if this should be backported to 2.5 or 2.5.1.
Armin suggested to wait (I'm of the same opinion). Thomas W thinks
it's fine to go in 2.5.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
there was no verification that privateobj was a PyString. If it wasn't
a string, this could have allowed a NULL pointer to creep in below and crash.
I wonder if this should be PyString_CheckExact? Must identifiers be strings
or can they be subclasses?
Klocwork #275
|
|
|
|
|
| |
in the byte code and co_consts even if they were not used, ie
immediately popped off the stack.
|
|
|
|
|
|
|
|
|
|
|
|
| |
on each iteration. I'm not positive this is the best way to handle
this. I'm also not sure that there aren't other cases where
the lnotab is generated incorrectly. It would be great if people
that use pdb or tracing could test heavily.
Also:
* Remove dead/duplicated code that wasn't used/necessary
because we already handled the docstring prior to entering the loop.
* add some debugging code into the compiler (#if 0'd out).
|
| |
|
|
|
|
|
|
| |
to stackdepth_walk it will be dereffed.
Not sure if I found with failmalloc or Klockwork #55.
|
| |
|
| |
|
|
|
|
| |
had more than 255 blank lines. Byte codes need to go first, line #s second.
|
|
|
|
| |
started after line 256.
|
| |
|
| |
|
|
|
|
| |
(thanks to Neal for review)
|
| |
|
|
|
|
|
|
|
|
| |
discussion.
There are two places of documentation that still mention __context__:
Doc/lib/libstdtypes.tex -- I wasn't quite sure how to rewrite that without
spending a whole lot of time thinking about it; and whatsnew, which Andrew
usually likes to change himself.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
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 ;)
|
| |
|