This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author arigo
Recipients
Date 2005-09-04.13:09:42
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=4771

The compiler package contains several bugs along the lines
of the one reported here.  It doesn't seem to be that much
used; with PyPy it is probably the first time that this
package is tested in-depth, as we are trying to pass
CPython's own test suite by using only this compiler
package.  We had to make a few involved fixes.

Attached is a diff against the 2.4 maintenance head of
CPython (we based our changes on 2.4.1).  If there is
interest, I can extract individual parts of the big diff
and/or port them to 2.5 CVS HEAD.  For now I will only give
a quick overview of the diff.

* the more involved problem was related to scoping of
variables.  This turned out to be more difficult to fix than
mwh's patch (included in this tracker).  (Disclaimer:
Michael never pretended his patch was more than a quick
hack.)  For reference, see the following code snippets:
http://codespeak.net/svn/pypy/dist/pypy/interpreter/test/test_syntax.py


* we try to always raise SyntaxErrors with line number
information.  (Note sure if this has been done completely yet.)

* pyassem.py has some heavy changes that I cannot comment on
(don't know about them).  Other changes there are related to
scoping flags.

* a number of situations should raise a SyntaxError, but
were silently accepted (and generally produce weird bytecodes).

* fixed docstring handling.  Previously, in interactive
mode, entering "hello" produced no result at all -- because
the string was interpreted as a docstring!  Also, a genuine
docstring on the same line as a statement -- "docstring";
x=5 -- would result in the statement being ignored.

* we can pass future flags from outside now.

* lambda functions didn't get the official name <lambda>. 
(Yeah, I know it's a detail, but a CPython test fails
because of that.)

* added raising of SyntaxWarnings.

* the st->ast transformer 'single' mode now returns a Module
AST node instead of a Stmt.  This matches more closely what
the rest of the package expects.

* some minor changes in transformer.py are probably not
interesting to CPython (e.g. changing some () into []). 
Their goal was to make transformer.py statically typeable
for PyPy.
History
Date User Action Args
2007-08-23 15:43:36adminlinkissue1251748 messages
2007-08-23 15:43:36admincreate