[Patches] [ python-Patches-526840 ] PEP 263 Implementation

noreply@sourceforge.net noreply@sourceforge.net
Thu, 07 Mar 2002 03:06:43 -0800


Patches item #526840, was opened at 2002-03-07 08:55
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=526840&group_id=5470

Category: Parser/Compiler
Group: None
Status: Open
Resolution: None
>Priority: 7
Submitted By: Martin v. Löwis (loewis)
Assigned to: M.-A. Lemburg (lemburg)
Summary: PEP 263 Implementation

Initial Comment:
The attached patch implements PEP 263. The following
differences to the PEP (rev. 1.8) are known:

- The implementation interprets "ASCII compatible" as
meaning "bytes below 128 always denote ASCII
characters", although this property is only used for
",', and \. There have been other readings of "ASCII
compatible", so this should probably be elaborated in
the PEP.

- The check whether all bytes follow the declared or
system encoding (including comments and string
literals) is only performed if the encoding is "ascii".


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

>Comment By: M.-A. Lemburg (lemburg)
Date: 2002-03-07 11:06

Message:
Logged In: YES 
user_id=38388

Thank you !

I'll add a note to the PEP about the way the first two lines
are processed (removing the ASCII mention...).

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

Comment By: Martin v. Löwis (loewis)
Date: 2002-03-07 09:11

Message:
Logged In: YES 
user_id=21627

A note on the implementation strategy: it turned out that
communicating the encoding into the abstract syntax was the
biggest challenge. 

To solve this, I introduced encoding_decl pseudo node: it is
an unused non-terminal whose STR() is the encoding, and
whose only child is the true root of the syntax tree. As
such, it is the only non-terminal which has a STR value.

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

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