[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-patches
Subject:    [Patches] [ python-Patches-401782 ] Enhances 1.6 compiler to raise 'proper' SyntaxErrors
From:       nobody () sourceforge ! net (nobody)
Date:       2001-02-28 7:13:49
Message-ID: E14Y0o1-0001ti-00 () usw-sf-web2 ! sourceforge ! net
[Download RAW message or body]

Patches #401782, was updated on 2000-10-04 12:24
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=401782&group_id=5470

Category: Parser/Compiler
Group: None
Status: Closed
Priority: 5
Submitted By: Roman Sulzhyk
Assigned to: Jeremy Hylton
Summary: Enhances 1.6 compiler to raise 'proper' SyntaxErrors

Initial Comment:
 

----------------------------------------------------------------------

Comment By: Jeremy Hylton
Date: 2001-02-27 23:13

Message:
Logged In: YES 
user_id=31392

This patch does a lot of work to keep the actual file
pointer or string passed to the compiler, then re-use it
when a SyntaxError is raised.  This seems more complicated
than necessary for file compilation, because the compiler
can just re-open the file.
I have opted for this approach in rev. 2.175 for compile.c.

The downside of the choice is that expressions entered at
the interactive prompt don't appear in the exception.  I
think this isn't a big problem, because the text was just
entered.

The changes in 2.175 are also more cleanly integrated with
the exception raising facilities.

It may be worth re-considering the interactive version of
the patch
after 2.1b1.



----------------------------------------------------------------------

Comment By: Jeremy Hylton
Date: 2001-02-02 10:36

Message:
Oh, BTW, with all the changes to the compiler for 2.1, this patch
no longer works.  If you're interested in updating it, I'd appreciate
it.  I'll look at the patch either way, though.

----------------------------------------------------------------------

Comment By: Jeremy Hylton
Date: 2001-02-02 10:35

Message:
I didn't get a chance to look at this before 2.1a2.  I will look at it
before 2.1b1, because it appears to fall under the bug fix category.


----------------------------------------------------------------------

Comment By: Guido van Rossum
Date: 2001-01-19 14:51

Message:
This is better for Jeremy to review, since he has done a major refactoring on the \
compiler code.

Jeremy, I don't want this in 2.1a1, but could you see if you can get it either \
approved or rejected in time for 2.1a2?


----------------------------------------------------------------------

Comment By: Roman Sulzhyk
Date: 2000-10-09 10:59

Message:
I've ported it to the latest CVS version - check it out,

Roman

----------------------------------------------------------------------

Comment By: Fred L. Drake, Jr.
Date: 2000-10-04 23:40

Message:
This needs to be ported to the latest CVS version before being considered for \
implementation (but discussion of the feature is welcome!).

This cannot be considered for inclusion in 2.0 since we're in feature freeze already, \
and are only fixing bugs at this point.   This can be considered for 2.1.

Marking as postponed.

----------------------------------------------------------------------

Comment By: Roman Sulzhyk
Date: 2000-10-04 12:29

Message:

	Hello:

	There's a problem with the compiler.c (which persists in 2.0 also) which means it \
raises 'old style' SyntaxErrors, which could not be formatted properly. I mentioned \
this to Guido during the last conference, and he said it can best be done by moving \
parts of the 'linecache' functionality to core python, or something along those \
lines. Well, I've put together something which is not so far-fetching, but plugs this \
hole. The only time it reverts to the 'old style' compile error is when the input \
file is not a regular file (like stdin), since the line information is lost at that \
point - don't think parser.c saves it anywhere. 

	Tell me what you think - should I port it to 2.0, or just drop it altogether if it's \
not needed. 

	Thanks,

	Roman

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=401782&group_id=5470


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic