From 8490b30a81597c75848f87611ca9ca011851db12 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 29 Nov 2016 21:26:26 +0000 Subject: Raise error on unrecognised document element --- mammoth/styles/parser/document_matcher_parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mammoth/styles/parser') diff --git a/mammoth/styles/parser/document_matcher_parser.py b/mammoth/styles/parser/document_matcher_parser.py index 3f9687d..6d69a8f 100644 --- a/mammoth/styles/parser/document_matcher_parser.py +++ b/mammoth/styles/parser/document_matcher_parser.py @@ -1,4 +1,5 @@ from ... import documents, document_matchers +from .errors import LineParseError from .tokeniser import TokenType from .token_parser import try_parse_class_name, parse_string @@ -40,8 +41,7 @@ def parse_document_matcher(tokens): return document_matchers.comment_reference else: - # TODO: raise - pass + raise LineParseError("Unrecognised document element: {0}".format(tokens.next_value(TokenType.IDENTIFIER))) def _parse_style_name(tokens): if tokens.try_skip(TokenType.SYMBOL, "["): -- cgit v1.2.3