From c8516d0a4e9467d4313af4ba63196bca184812b3 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 24 Nov 2016 22:13:00 +0000 Subject: Use recursive descent parser instead of parsimonious --- mammoth/styles/parser/token_iterator.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'mammoth/styles/parser/token_iterator.py') 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() + -- cgit v1.2.3