summaryrefslogtreecommitdiff
path: root/src/pugixpath.cpp
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-05-30 20:44:15 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-05-30 20:44:15 +0000
commit555a184f4f8223141434db41429eb68f5f8fd916 (patch)
tree441480cc8c38f89eb60b082fa0c314c2f69a7d24 /src/pugixpath.cpp
parent97a761615f6db3be5f87b258e5288c09d445942c (diff)
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
Diffstat (limited to 'src/pugixpath.cpp')
-rw-r--r--src/pugixpath.cpp9
1 files changed, 5 insertions, 4 deletions
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");