From 555a184f4f8223141434db41429eb68f5f8fd916 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Sun, 30 May 2010 20:44:15 +0000 Subject: Fixed XPath parsing (numbers of the form \d+\. are now parsed correctly, stray colon does not act as eof token) git-svn-id: http://pugixml.googlecode.com/svn/trunk@476 99668b35-9821-0410-8761-19e4c4f06640 --- src/pugixpath.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/pugixpath.cpp') diff --git a/src/pugixpath.cpp b/src/pugixpath.cpp index 00cb56d..a22943b 100644 --- a/src/pugixpath.cpp +++ b/src/pugixpath.cpp @@ -861,7 +861,8 @@ namespace pugi lex_axis_attribute, lex_dot, lex_double_dot, - lex_double_colon + lex_double_colon, + lex_eof }; struct xpath_lexer_string @@ -926,7 +927,7 @@ namespace pugi switch (*m_cur) { case 0: - m_cur_lexeme = lex_none; + m_cur_lexeme = lex_eof; break; case '>': @@ -1118,7 +1119,7 @@ namespace pugi while (IS_CHARTYPEX(*m_cur, ctx_digit)) m_cur++; - if (*m_cur == '.' && IS_CHARTYPEX(*(m_cur+1), ctx_digit)) + if (*m_cur == '.') { m_cur++; @@ -3558,7 +3559,7 @@ namespace pugi { xpath_ast_node* result = parse_expression(); - if (m_lexer.current() != lex_none) + if (m_lexer.current() != lex_eof) { // there are still unparsed tokens left, error throw xpath_exception("Incorrect query"); -- cgit v1.2.3