1.1 --- a/moinformat/parsers/common.py Sat Jul 14 15:36:34 2018 +0200
1.2 +++ b/moinformat/parsers/common.py Sat Jul 14 16:17:36 2018 +0200
1.3 @@ -137,6 +137,15 @@
1.4 self.pos = len(self.s)
1.5 return None
1.6
1.7 + def match_groups(self):
1.8 +
1.9 + "Return the match groups."
1.10 +
1.11 + if self.match:
1.12 + return self.match.groups()
1.13 + else:
1.14 + return []
1.15 +
1.16
1.17
1.18 # Parser abstractions.
1.19 @@ -214,6 +223,12 @@
1.20
1.21 return self.items.matching
1.22
1.23 + def match_groups(self):
1.24 +
1.25 + "Return the number of groups in the match."
1.26 +
1.27 + return self.items.match_groups()
1.28 +
1.29 # Parser methods invoked from other objects.
1.30
1.31 def parse(self, s):