diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-11-29 21:54:31 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-11-29 21:54:31 +0000 |
| commit | 5bc676b074a651a70b3b259182a94120c036d74a (patch) | |
| tree | 5a7a46be69566f3472c4ca841983b7d6c6d60b4f /mammoth/styles/parser/token_iterator.py | |
| parent | 95394c062b971179a7fda954771bdb6390ba88b7 (diff) | |
Raise error on unrecognised string matcher
Diffstat (limited to 'mammoth/styles/parser/token_iterator.py')
| -rw-r--r-- | mammoth/styles/parser/token_iterator.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mammoth/styles/parser/token_iterator.py b/mammoth/styles/parser/token_iterator.py index 027775b..fded56d 100644 --- a/mammoth/styles/parser/token_iterator.py +++ b/mammoth/styles/parser/token_iterator.py @@ -12,12 +12,12 @@ class TokenIterator(object): def peek_token_type(self): return self._tokens[self._index].type - def next_value(self, token_type): + def next_value(self, token_type=None): return self._next(token_type).value - def _next(self, token_type): + def _next(self, token_type=None): token = self._tokens[self._index] - if token.type == token_type: + if token_type is None or token.type == token_type: self._index += 1 return token else: |
