Optimization step.
This commit is contained in:
parent
069f9a1314
commit
4fda35480f
1 changed files with 2 additions and 2 deletions
|
@ -94,7 +94,7 @@ class CrossRef:
|
|||
return None
|
||||
def mark_matching_resources(self, pattern, fn, n):
|
||||
"Mark all definitions matching a specified pattern with a reference."
|
||||
pattern = re.compile(re.escape(pattern) + "$")
|
||||
pattern = re.compile("^" + pattern + "$")
|
||||
key = None
|
||||
for trial in self.fileref:
|
||||
if pattern.match(trial):
|
||||
|
@ -185,7 +185,7 @@ class CrossRef:
|
|||
# it as a reference to everything the substitutions
|
||||
# could potentially match.
|
||||
elif '{' in name:
|
||||
pattern = "^" + re.sub(r"\{[^}]*\}", '.*', name)
|
||||
pattern = re.sub(r"\{[^}]*\}", '.*', name)
|
||||
key = self.mark_matching_resources(pattern, fn,n+1)
|
||||
if key:
|
||||
self.fileref[key].append(fn, n+1)
|
||||
|
|
Loading…
Add table
Reference in a new issue