fixes/updates

This commit is contained in:
Jan Petykiewicz 2023-02-09 16:38:33 -08:00 committed by jan
commit 85a2eb6acc
3 changed files with 17 additions and 4 deletions

View file

@ -200,6 +200,9 @@ class Ref(
return None
if library is not None and self.target not in library:
raise PatternError(f'get_bounds() called on dangling reference to "{self.target}"')
if pattern is not None and pattern.is_empty():
# no need to run as_pattern()
return None
return self.as_pattern(pattern=pattern, library=library).get_bounds(library)
def __repr__(self) -> str: