diff markup/path.py @ 164:1f6cb675a66c trunk

Report error when position predicates are used in XPath expressions (which is NYI).
author cmlenz
date Wed, 16 Aug 2006 23:06:32 +0000
parents 9c023c395e44
children dc6676d3b697
line wrap: on
line diff
--- a/markup/path.py
+++ b/markup/path.py
@@ -359,6 +359,8 @@
         assert self.cur_token == '['
         self.next_token()
         expr = self._or_expr()
+        if isinstance(expr, NumberLiteral):
+            raise PathSyntaxError('Position predicates not yet supported')
         if self.cur_token != ']':
             raise PathSyntaxError('Expected "]" to close predicate, '
                                   'but found "%s"' % self.cur_token,
Copyright (C) 2012-2017 Edgewall Software