summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-08-31 12:28:20 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-08-31 12:28:20 +0000
commit7797d49ed6165785a9264e1d7266c3b63e534ee2 (patch)
tree10d6c204e7fe7a4ed725cc2ae6f645adf1f90094 /src
parent0eb2da46865ef6ebf45e8da9c980da89e5f3aa3d (diff)
XPath fixes (now it should fail to compile incorrect queries)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@123 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'src')
-rw-r--r--src/pugixpath.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/pugixpath.cpp b/src/pugixpath.cpp
index 8111b23..de166f4 100644
--- a/src/pugixpath.cpp
+++ b/src/pugixpath.cpp
@@ -1070,6 +1070,10 @@ namespace pugi
m_cur_lexeme = lex_string;
}
+ else
+ {
+ throw xpath_exception("Unrecognized token");
+ }
}
}
@@ -3496,7 +3500,15 @@ namespace pugi
xpath_ast_node* parse()
{
- return parse_expression();
+ xpath_ast_node* result = parse_expression();
+
+ if (m_lexer.current() != lex_none)
+ {
+ // there are still unparsed tokens left, error
+ throw xpath_exception("Incorrect query");
+ }
+
+ return result;
}
};