aboutsummaryrefslogtreecommitdiff
path: root/mammoth/styles/parser/token_iterator.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-11-24 22:13:00 +0000
committerMichael Williamson <mike@zwobble.org>2016-11-24 22:15:35 +0000
commitc8516d0a4e9467d4313af4ba63196bca184812b3 (patch)
treedd6235081faf3e3fba7ddda3535d6c48654fb781 /mammoth/styles/parser/token_iterator.py
parent507700470b46329ea8b1f8191e48fa69a24a8deb (diff)
Use recursive descent parser instead of parsimonious
Diffstat (limited to 'mammoth/styles/parser/token_iterator.py')
-rw-r--r--mammoth/styles/parser/token_iterator.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/mammoth/styles/parser/token_iterator.py b/mammoth/styles/parser/token_iterator.py
index 114ce28..027775b 100644
--- a/mammoth/styles/parser/token_iterator.py
+++ b/mammoth/styles/parser/token_iterator.py
@@ -1,4 +1,8 @@
# TODO: check indices
+# TODO: proper tests for unexpected tokens
+
+from .errors import LineParseError
+
class TokenIterator(object):
def __init__(self, tokens):
@@ -46,4 +50,7 @@ class TokenIterator(object):
self._index += 1
return True
-
+
+ def _unexpected_token_type(self, token_type, token):
+ raise LineParseError()
+