[Python-checkins] cpython (3.4): Idle ColorDelegator: remove special case code for 'as' in import statements.

terry.reedy python-checkins at python.org
Tue Aug 19 23:19:05 CEST 2014


http://hg.python.org/cpython/rev/f54241c25354
changeset:   92158:f54241c25354
branch:      3.4
parent:      92154:0788d0d6bf85
user:        Terry Jan Reedy <tjreedy at udel.edu>
date:        Tue Aug 19 17:17:57 2014 -0400
summary:
  Idle ColorDelegator: remove special case code for 'as' in import statements.
'As' became a full keyword when with statements were added in 2.5/2.6.

files:
  Lib/idlelib/ColorDelegator.py |  17 -----------------
  1 files changed, 0 insertions(+), 17 deletions(-)


diff --git a/Lib/idlelib/ColorDelegator.py b/Lib/idlelib/ColorDelegator.py
--- a/Lib/idlelib/ColorDelegator.py
+++ b/Lib/idlelib/ColorDelegator.py
@@ -32,7 +32,6 @@
 
 prog = re.compile(make_pat(), re.S)
 idprog = re.compile(r"\s+(\w+)", re.S)
-asprog = re.compile(r".*?\b(as)\b")
 
 class ColorDelegator(Delegator):
 
@@ -213,22 +212,6 @@
                                     self.tag_add("DEFINITION",
                                                  head + "+%dc" % a,
                                                  head + "+%dc" % b)
-                            elif value == "import":
-                                # color all the "as" words on same line, except
-                                # if in a comment; cheap approximation to the
-                                # truth
-                                if '#' in chars:
-                                    endpos = chars.index('#')
-                                else:
-                                    endpos = len(chars)
-                                while True:
-                                    m1 = self.asprog.match(chars, b, endpos)
-                                    if not m1:
-                                        break
-                                    a, b = m1.span(1)
-                                    self.tag_add("KEYWORD",
-                                                 head + "+%dc" % a,
-                                                 head + "+%dc" % b)
                     m = self.prog.search(chars, m.end())
                 if "SYNC" in self.tag_names(next + "-1c"):
                     head = next

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list