Kaydet (Commit) 8a0232d8 authored tarafından Fredrik Lundh's avatar Fredrik Lundh

SF bug #476912: flag repeated use of the same groupname as

the error it really is (and always has been)
üst 4e8ab5db
...@@ -81,6 +81,8 @@ class Pattern: ...@@ -81,6 +81,8 @@ class Pattern:
gid = self.groups gid = self.groups
self.groups = gid + 1 self.groups = gid + 1
if name: if name:
if self.groupdict.has_key(name):
raise error, "can only use each group name once"
self.groupdict[name] = gid self.groupdict[name] = gid
self.open.append(gid) self.open.append(gid)
return gid return gid
...@@ -189,7 +191,7 @@ class Tokenizer: ...@@ -189,7 +191,7 @@ class Tokenizer:
try: try:
c = self.string[self.index + 1] c = self.string[self.index + 1]
except IndexError: except IndexError:
raise error, "bogus escape" raise error, "bogus escape (end of line)"
char = char + c char = char + c
self.index = self.index + len(char) self.index = self.index + len(char)
self.next = char self.next = char
......
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