Skip to content

Commit

Permalink
Go back in ancient elif times.
Browse files Browse the repository at this point in the history
  • Loading branch information
PapyChacal committed Aug 2, 2024
1 parent 2072c07 commit 0e93faa
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions filecheck/matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,15 +370,14 @@ def _approximate_uop_length(self, uops: Sequence[UOp]) -> int:
"""
count = 0
for op in uops:
match op:
case Subst(variable):
count += len(str(self.ctx.live_variables.get(variable, "")))
case Literal(content):
count += len(content)
case RE(content):
count += len(content)
case Capture(pattern):
count += len(pattern)
case _:
continue
if isinstance(op, Subst):
count += len(str(self.ctx.live_variables.get(op.variable, "")))
elif isinstance(op, Literal):
count += len(op.content)
elif isinstance(op, RE):
count += len(op.content)
elif isinstance(op, Capture):
count += len(op.pattern)
else:
continue
return count

0 comments on commit 0e93faa

Please sign in to comment.