(mobj)
| 130 | substr = named_re.sub(r"<\1>", substr) # get rid of definition templates |
| 131 | |
| 132 | def listrepl(mobj): |
| 133 | thelist = conv(mobj.group(1).replace(r'\,', '@comma@')) |
| 134 | if template_name_re.match(thelist): |
| 135 | return "<%s>" % (thelist) |
| 136 | name = None |
| 137 | for key in lnames.keys(): # see if list is already in dictionary |
| 138 | if lnames[key] == thelist: |
| 139 | name = key |
| 140 | if name is None: # this list is not in the dictionary yet |
| 141 | name = unique_key(lnames) |
| 142 | lnames[name] = thelist |
| 143 | return "<%s>" % name |
| 144 | |
| 145 | substr = list_re.sub(listrepl, substr) # convert all lists to named templates |
| 146 | # newnames are constructed as needed |
nothing calls this directly
no test coverage detected