Commit 52ed7550 authored by Terry Jan Reedy's avatar Terry Jan Reedy

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.
parent 2426da89
......@@ -34,7 +34,6 @@ def make_pat():
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):
......@@ -215,22 +214,6 @@ class ColorDelegator(Delegator):
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment