summaryrefslogtreecommitdiff
path: root/boost/spirit/home/qi/operator/expect.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2017-09-13 11:24:46 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2017-09-13 11:25:39 +0900
commit4fadd968fa12130524c8380f33fcfe25d4de79e5 (patch)
treefd26a490cd15388d42fc6652b3c5c13012e7f93e /boost/spirit/home/qi/operator/expect.hpp
parentb5c87084afaef42b2d058f68091be31988a6a874 (diff)
downloadboost-upstream/1.65.0.tar.gz
boost-upstream/1.65.0.tar.bz2
boost-upstream/1.65.0.zip
Imported Upstream version 1.65.0upstream/1.65.0
Change-Id: Icf8400b375482cb11bcf77440a6934ba360d6ba4 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/spirit/home/qi/operator/expect.hpp')
-rw-r--r--boost/spirit/home/qi/operator/expect.hpp32
1 files changed, 9 insertions, 23 deletions
diff --git a/boost/spirit/home/qi/operator/expect.hpp b/boost/spirit/home/qi/operator/expect.hpp
index ff279fd5d1..540372c33f 100644
--- a/boost/spirit/home/qi/operator/expect.hpp
+++ b/boost/spirit/home/qi/operator/expect.hpp
@@ -14,11 +14,11 @@
#include <boost/spirit/home/qi/operator/sequence_base.hpp>
#include <boost/spirit/home/qi/detail/expect_function.hpp>
+#include <boost/spirit/home/qi/detail/expectation_failure.hpp>
#include <boost/spirit/home/qi/meta_compiler.hpp>
#include <boost/spirit/home/support/has_semantic_action.hpp>
#include <boost/spirit/home/support/handles_container.hpp>
#include <boost/spirit/home/support/info.hpp>
-#include <stdexcept>
namespace boost { namespace spirit
{
@@ -36,27 +36,13 @@ namespace boost { namespace spirit
namespace boost { namespace spirit { namespace qi
{
- template <typename Iterator>
- struct expectation_failure : std::runtime_error
- {
- expectation_failure(Iterator first_, Iterator last_, info const& what)
- : std::runtime_error("boost::spirit::qi::expectation_failure")
- , first(first_), last(last_), what_(what)
- {}
- ~expectation_failure() throw() {}
-
- Iterator first;
- Iterator last;
- info what_;
- };
-
template <typename Elements>
- struct expect : sequence_base<expect<Elements>, Elements>
+ struct expect_operator : sequence_base<expect_operator<Elements>, Elements>
{
- friend struct sequence_base<expect<Elements>, Elements>;
+ friend struct sequence_base<expect_operator<Elements>, Elements>;
- expect(Elements const& elements)
- : sequence_base<expect<Elements>, Elements>(elements) {}
+ expect_operator(Elements const& elements)
+ : sequence_base<expect_operator<Elements>, Elements>(elements) {}
private:
@@ -73,7 +59,7 @@ namespace boost { namespace spirit { namespace qi
(first, last, context, skipper);
}
- std::string id() const { return "expect"; }
+ std::string id() const { return "expect_operator"; }
};
///////////////////////////////////////////////////////////////////////////
@@ -81,7 +67,7 @@ namespace boost { namespace spirit { namespace qi
///////////////////////////////////////////////////////////////////////////
template <typename Elements, typename Modifiers>
struct make_composite<proto::tag::greater, Elements, Modifiers>
- : make_nary_composite<Elements, expect>
+ : make_nary_composite<Elements, expect_operator>
{};
}}}
@@ -89,13 +75,13 @@ namespace boost { namespace spirit { namespace traits
{
///////////////////////////////////////////////////////////////////////////
template <typename Elements>
- struct has_semantic_action<qi::expect<Elements> >
+ struct has_semantic_action<qi::expect_operator<Elements> >
: nary_has_semantic_action<Elements> {};
///////////////////////////////////////////////////////////////////////////
template <typename Elements, typename Attribute, typename Context
, typename Iterator>
- struct handles_container<qi::expect<Elements>, Attribute, Context
+ struct handles_container<qi::expect_operator<Elements>, Attribute, Context
, Iterator>
: mpl::true_ {};
}}}