Commit 929c2246 authored by Evan Simpson's avatar Evan Simpson

Fix Collector #468 properly

parent a2d2befc
......@@ -113,15 +113,14 @@ _attr_re = re.compile(r"\s*([^\s]+)\s+([^\s].*)\Z", re.S)
_subst_re = re.compile(r"\s*(?:(text|structure)\s+)?(.*)\Z", re.S)
del re
def parseAttributeReplacements(arg, xml):
def parseAttributeReplacements(arg):
dict = {}
for part in splitParts(arg):
m = _attr_re.match(part)
if not m:
raise TALError("Bad syntax in attributes:" + `part`)
name, expr = m.group(1, 2)
if xml:
name = name.lower()
name = name.lower()
if dict.has_key(name):
raise TALError("Duplicate attribute name in attributes:" + `part`)
dict[name] = expr
......
......@@ -646,8 +646,7 @@ class TALGenerator:
self.pushProgram()
if attrsubst or i18nattrs:
if attrsubst:
repldict = TALDefs.parseAttributeReplacements(attrsubst,
self.xml)
repldict = TALDefs.parseAttributeReplacements(attrsubst)
else:
repldict = {}
if i18nattrs:
......
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