Skip to content

Commit

Permalink
added some utility method to inspect matching result
Browse files Browse the repository at this point in the history
Evgenus committed Mar 12, 2023
1 parent 64bfd5a commit 8b83e47
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions asty/visitors.py
Original file line number Diff line number Diff line change
@@ -86,6 +86,9 @@ def __getitem__(self, key: str):
if match.context == key:
yield match

def keys(self):
return [match.context for match in self.matches]

def attach(self, *sub_match: 'MatchingResult'):
self.matches.extend(sub_match)
return self

0 comments on commit 8b83e47

Please sign in to comment.