Skip to content
Snippets Groups Projects
Commit 393f2029 authored by Robert Bossy's avatar Robert Bossy
Browse files

fixed name type rejection

parent 2a9080e7
No related branches found
No related tags found
No related merge requests found
......@@ -660,10 +660,13 @@ class PatternSaturator(Saturator):
self.pattern = re.compile(pattern)
self.name_type = name_type
self.replacements = tuple(replacements)
self.name_type_restriction = name_type_restriction
if name_type_restriction is None:
self.name_type_restriction = None
else:
self.name_type_restriction = set(name_type_restriction)
def saturate(self, name):
if self.name_type_restriction is None or self.name_type_restriction == name.name_type:
if self.name_type_restriction is None or name.name_type in self.name_type_restriction:
match = self.pattern.fullmatch(name.value)
if match is not None:
groups = list(match.groups())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment