summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/SelectorToken.cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2013-03-20 02:03:19 +0000
committerAndrew Stitcher <astitcher@apache.org>2013-03-20 02:03:19 +0000
commit555ea990a42f4d391e1f27d6e90789abe0bd76bc (patch)
treeaafc0333eb09f36317adbfc09c90add0a112b061 /cpp/src/qpid/broker/SelectorToken.cpp
parent4afa6ad8b26a8302ccf7a8559def2268a296110a (diff)
downloadqpid-python-555ea990a42f4d391e1f27d6e90789abe0bd76bc.tar.gz
QPID-4558: C++ broker selectors: Improved error reporting
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1458610 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SelectorToken.cpp')
-rw-r--r--cpp/src/qpid/broker/SelectorToken.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/cpp/src/qpid/broker/SelectorToken.cpp b/cpp/src/qpid/broker/SelectorToken.cpp
index 1e84834e18..e745bc3889 100644
--- a/cpp/src/qpid/broker/SelectorToken.cpp
+++ b/cpp/src/qpid/broker/SelectorToken.cpp
@@ -132,8 +132,8 @@ bool processString(std::string::const_iterator& s, std::string::const_iterator&
++q;
}
+ tok = Token(T_STRING, s, content);
s = q;
- tok = Token(T_STRING, content);
return true;
}
@@ -171,7 +171,7 @@ bool tokenise(std::string::const_iterator& s, std::string::const_iterator& e, To
while (true)
switch (state) {
case START:
- if (t==e) {tok = Token(T_EOS, ""); return true;}
+ if (t==e) {tok = Token(T_EOS, s, "<END>"); return true;}
else switch (*t) {
case '(': tokType = T_LPAREN; state = ACCEPT_INC; continue;
case ')': tokType = T_RPAREN; state = ACCEPT_INC; continue;
@@ -259,6 +259,7 @@ bool tokenise(std::string::const_iterator& s, std::string::const_iterator& e, To
Tokeniser::Tokeniser(const std::string::const_iterator& s, const std::string::const_iterator& e) :
tokp(0),
+ inStart(s),
inp(s),
inEnd(e)
{
@@ -294,5 +295,11 @@ void Tokeniser::returnTokens(unsigned int n)
tokp-=n;
}
+std::string Tokeniser::remaining()
+{
+ Token& currentTok = tokens[tokp];
+ return std::string(currentTok.tokenStart, inEnd);
+}
+
}}