summaryrefslogtreecommitdiff
path: root/boost/spirit/home/x3/operator
diff options
context:
space:
mode:
Diffstat (limited to 'boost/spirit/home/x3/operator')
-rw-r--r--boost/spirit/home/x3/operator/alternative.hpp4
-rw-r--r--boost/spirit/home/x3/operator/and_predicate.hpp4
-rw-r--r--boost/spirit/home/x3/operator/detail/alternative.hpp4
-rw-r--r--boost/spirit/home/x3/operator/detail/sequence.hpp62
-rw-r--r--boost/spirit/home/x3/operator/difference.hpp4
-rw-r--r--boost/spirit/home/x3/operator/kleene.hpp4
-rw-r--r--boost/spirit/home/x3/operator/list.hpp4
-rw-r--r--boost/spirit/home/x3/operator/not_predicate.hpp4
-rw-r--r--boost/spirit/home/x3/operator/optional.hpp4
-rw-r--r--boost/spirit/home/x3/operator/plus.hpp4
-rw-r--r--boost/spirit/home/x3/operator/sequence.hpp4
11 files changed, 63 insertions, 39 deletions
diff --git a/boost/spirit/home/x3/operator/alternative.hpp b/boost/spirit/home/x3/operator/alternative.hpp
index c3a1e40f3f..1a436e1e69 100644
--- a/boost/spirit/home/x3/operator/alternative.hpp
+++ b/boost/spirit/home/x3/operator/alternative.hpp
@@ -4,8 +4,8 @@
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
-#if !defined(SPIRIT_ALTERNATIVE_JAN_07_2013_1131AM)
-#define SPIRIT_ALTERNATIVE_JAN_07_2013_1131AM
+#if !defined(BOOST_SPIRIT_X3_ALTERNATIVE_JAN_07_2013_1131AM)
+#define BOOST_SPIRIT_X3_ALTERNATIVE_JAN_07_2013_1131AM
#include <boost/spirit/home/x3/support/traits/attribute_of.hpp>
#include <boost/spirit/home/x3/core/parser.hpp>
diff --git a/boost/spirit/home/x3/operator/and_predicate.hpp b/boost/spirit/home/x3/operator/and_predicate.hpp
index 1d650f7521..0ee1652555 100644
--- a/boost/spirit/home/x3/operator/and_predicate.hpp
+++ b/boost/spirit/home/x3/operator/and_predicate.hpp
@@ -4,8 +4,8 @@
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
-#if !defined(SPIRIT_AND_PREDICATE_MARCH_23_2007_0617PM)
-#define SPIRIT_AND_PREDICATE_MARCH_23_2007_0617PM
+#if !defined(BOOST_SPIRIT_X3_AND_PREDICATE_MARCH_23_2007_0617PM)
+#define BOOST_SPIRIT_X3_AND_PREDICATE_MARCH_23_2007_0617PM
#include <boost/spirit/home/x3/core/parser.hpp>
diff --git a/boost/spirit/home/x3/operator/detail/alternative.hpp b/boost/spirit/home/x3/operator/detail/alternative.hpp
index 0043710320..2c87fa0376 100644
--- a/boost/spirit/home/x3/operator/detail/alternative.hpp
+++ b/boost/spirit/home/x3/operator/detail/alternative.hpp
@@ -4,8 +4,8 @@
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
-#if !defined(SPIRIT_ALTERNATIVE_DETAIL_JAN_07_2013_1245PM)
-#define SPIRIT_ALTERNATIVE_DETAIL_JAN_07_2013_1245PM
+#if !defined(BOOST_SPIRIT_X3_ALTERNATIVE_DETAIL_JAN_07_2013_1245PM)
+#define BOOST_SPIRIT_X3_ALTERNATIVE_DETAIL_JAN_07_2013_1245PM
#include <boost/spirit/home/x3/support/traits/attribute_of.hpp>
#include <boost/spirit/home/x3/support/traits/is_variant.hpp>
diff --git a/boost/spirit/home/x3/operator/detail/sequence.hpp b/boost/spirit/home/x3/operator/detail/sequence.hpp
index 2c804cc78a..2d3bfec4da 100644
--- a/boost/spirit/home/x3/operator/detail/sequence.hpp
+++ b/boost/spirit/home/x3/operator/detail/sequence.hpp
@@ -4,8 +4,8 @@
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
-#if !defined(SPIRIT_SEQUENCE_DETAIL_JAN_06_2013_1015AM)
-#define SPIRIT_SEQUENCE_DETAIL_JAN_06_2013_1015AM
+#if !defined(BOOST_SPIRIT_X3_SEQUENCE_DETAIL_JAN_06_2013_1015AM)
+#define BOOST_SPIRIT_X3_SEQUENCE_DETAIL_JAN_06_2013_1015AM
#include <boost/spirit/home/x3/support/traits/attribute_of.hpp>
#include <boost/spirit/home/x3/support/traits/attribute_category.hpp>
@@ -13,11 +13,13 @@
#include <boost/spirit/home/x3/support/traits/has_attribute.hpp>
#include <boost/spirit/home/x3/support/traits/is_substitute.hpp>
#include <boost/spirit/home/x3/support/traits/container_traits.hpp>
+#include <boost/spirit/home/x3/support/traits/tuple_traits.hpp>
#include <boost/spirit/home/x3/core/detail/parse_into_container.hpp>
#include <boost/fusion/include/begin.hpp>
#include <boost/fusion/include/end.hpp>
#include <boost/fusion/include/advance.hpp>
+#include <boost/fusion/include/deref.hpp>
#include <boost/fusion/include/empty.hpp>
#include <boost/fusion/include/front.hpp>
#include <boost/fusion/include/iterator_range.hpp>
@@ -79,14 +81,16 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
};
template <typename Attribute>
- struct pass_sequence_attribute_front
+ struct pass_sequence_attribute_size_one_view
{
- typedef typename fusion::result_of::front<Attribute>::type type;
+ typedef typename fusion::result_of::deref<
+ typename fusion::result_of::begin<Attribute>::type
+ >::type type;
static typename add_reference<type>::type
call(Attribute& attr)
{
- return fusion::front(attr);
+ return fusion::deref(fusion::begin(attr));
}
};
@@ -103,30 +107,30 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
}
};
- template <typename Parser, typename Attribute, bool pass_through>
+ template <typename Parser, typename Attribute>
struct pass_sequence_attribute_used :
- mpl::if_c<
- (!pass_through && traits::is_size_one_sequence<Attribute>::value)
- , pass_sequence_attribute_front<Attribute>
+ mpl::if_<
+ traits::is_size_one_view<Attribute>
+ , pass_sequence_attribute_size_one_view<Attribute>
, pass_through_sequence_attribute<Attribute>>::type {};
- template <typename Parser, typename Attribute, bool pass_through = false, typename Enable = void>
+ template <typename Parser, typename Attribute, typename Enable = void>
struct pass_sequence_attribute :
mpl::if_<
fusion::result_of::empty<Attribute>
, pass_sequence_attribute_unused
- , pass_sequence_attribute_used<Parser, Attribute, pass_through>>::type {};
+ , pass_sequence_attribute_used<Parser, Attribute>>::type {};
- template <typename L, typename R, typename Attribute, bool pass_through>
- struct pass_sequence_attribute<sequence<L, R>, Attribute, pass_through>
+ template <typename L, typename R, typename Attribute>
+ struct pass_sequence_attribute<sequence<L, R>, Attribute>
: pass_through_sequence_attribute<Attribute> {};
template <typename Parser, typename Attribute>
struct pass_sequence_attribute_subject :
pass_sequence_attribute<typename Parser::subject_type, Attribute> {};
- template <typename Parser, typename Attribute, bool pass_through>
- struct pass_sequence_attribute<Parser, Attribute, pass_through
+ template <typename Parser, typename Attribute>
+ struct pass_sequence_attribute<Parser, Attribute
, typename enable_if_c<(Parser::is_pass_through_unary)>::type>
: pass_sequence_attribute_subject<Parser, Attribute> {};
@@ -150,8 +154,8 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
typedef typename fusion::result_of::end<Attribute>::type r_end;
typedef fusion::iterator_range<l_begin, l_end> l_part;
typedef fusion::iterator_range<l_end, r_end> r_part;
- typedef pass_sequence_attribute<L, l_part, false> l_pass;
- typedef pass_sequence_attribute<R, r_part, false> r_pass;
+ typedef pass_sequence_attribute<L, l_part> l_pass;
+ typedef pass_sequence_attribute<R, r_part> r_pass;
static l_part left(Attribute& s)
{
@@ -175,7 +179,7 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
typedef unused_type l_part;
typedef Attribute& r_part;
typedef pass_sequence_attribute_unused l_pass;
- typedef pass_sequence_attribute<R, Attribute, true> r_pass;
+ typedef pass_sequence_attribute<R, Attribute> r_pass;
static unused_type left(Attribute&)
{
@@ -195,7 +199,7 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
{
typedef Attribute& l_part;
typedef unused_type r_part;
- typedef pass_sequence_attribute<L, Attribute, true> l_pass;
+ typedef pass_sequence_attribute<L, Attribute> l_pass;
typedef pass_sequence_attribute_unused r_pass;
static Attribute& left(Attribute& s)
@@ -359,6 +363,26 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
return parse_sequence_plain(parser, first, last, context, rcontext, attr);
}
+ template <typename Parser, typename Iterator, typename Context
+ , typename RContext, typename Attribute>
+ bool parse_sequence(
+ Parser const& parser, Iterator& first, Iterator const& last
+ , Context const& context, RContext& rcontext, Attribute& attr
+ , traits::optional_attribute)
+ {
+ return parse_sequence_plain(parser, first, last, context, rcontext, attr);
+ }
+
+ template <typename Parser, typename Iterator, typename Context
+ , typename RContext, typename Attribute>
+ bool parse_sequence(
+ Parser const& parser, Iterator& first, Iterator const& last
+ , Context const& context, RContext& rcontext, Attribute& attr
+ , traits::range_attribute)
+ {
+ return parse_sequence_plain(parser, first, last, context, rcontext, attr);
+ }
+
template <typename Left, typename Right, typename Iterator
, typename Context, typename RContext, typename Attribute>
bool parse_sequence(
diff --git a/boost/spirit/home/x3/operator/difference.hpp b/boost/spirit/home/x3/operator/difference.hpp
index a75e713821..8ca2a96888 100644
--- a/boost/spirit/home/x3/operator/difference.hpp
+++ b/boost/spirit/home/x3/operator/difference.hpp
@@ -4,8 +4,8 @@
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
-#if !defined(SPIRIT_DIFFERENCE_FEBRUARY_11_2007_1250PM)
-#define SPIRIT_DIFFERENCE_FEBRUARY_11_2007_1250PM
+#if !defined(BOOST_SPIRIT_X3_DIFFERENCE_FEBRUARY_11_2007_1250PM)
+#define BOOST_SPIRIT_X3_DIFFERENCE_FEBRUARY_11_2007_1250PM
#include <boost/spirit/home/x3/support/traits/attribute_of.hpp>
#include <boost/spirit/home/x3/support/traits/has_attribute.hpp>
diff --git a/boost/spirit/home/x3/operator/kleene.hpp b/boost/spirit/home/x3/operator/kleene.hpp
index b0fb5a1df1..1a9dcfaa56 100644
--- a/boost/spirit/home/x3/operator/kleene.hpp
+++ b/boost/spirit/home/x3/operator/kleene.hpp
@@ -5,8 +5,8 @@
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
-#if !defined(SPIRIT_KLEENE_JANUARY_07_2007_0818AM)
-#define SPIRIT_KLEENE_JANUARY_07_2007_0818AM
+#if !defined(BOOST_SPIRIT_X3_KLEENE_JANUARY_07_2007_0818AM)
+#define BOOST_SPIRIT_X3_KLEENE_JANUARY_07_2007_0818AM
#include <boost/spirit/home/x3/core/parser.hpp>
#include <boost/spirit/home/x3/support/traits/container_traits.hpp>
diff --git a/boost/spirit/home/x3/operator/list.hpp b/boost/spirit/home/x3/operator/list.hpp
index 23b398b128..392a9646a1 100644
--- a/boost/spirit/home/x3/operator/list.hpp
+++ b/boost/spirit/home/x3/operator/list.hpp
@@ -5,8 +5,8 @@
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
-#if !defined(SPIRIT_LIST_MARCH_24_2007_1031AM)
-#define SPIRIT_LIST_MARCH_24_2007_1031AM
+#if !defined(BOOST_SPIRIT_X3_LIST_MARCH_24_2007_1031AM)
+#define BOOST_SPIRIT_X3_LIST_MARCH_24_2007_1031AM
#include <boost/spirit/home/x3/core/parser.hpp>
#include <boost/spirit/home/x3/support/traits/container_traits.hpp>
diff --git a/boost/spirit/home/x3/operator/not_predicate.hpp b/boost/spirit/home/x3/operator/not_predicate.hpp
index d0302e6142..2fe6edab49 100644
--- a/boost/spirit/home/x3/operator/not_predicate.hpp
+++ b/boost/spirit/home/x3/operator/not_predicate.hpp
@@ -4,8 +4,8 @@
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
-#if !defined(SPIRIT_NOT_PREDICATE_MARCH_23_2007_0618PM)
-#define SPIRIT_NOT_PREDICATE_MARCH_23_2007_0618PM
+#if !defined(BOOST_SPIRIT_X3_NOT_PREDICATE_MARCH_23_2007_0618PM)
+#define BOOST_SPIRIT_X3_NOT_PREDICATE_MARCH_23_2007_0618PM
#include <boost/spirit/home/x3/core/parser.hpp>
diff --git a/boost/spirit/home/x3/operator/optional.hpp b/boost/spirit/home/x3/operator/optional.hpp
index a40228849a..70beefef21 100644
--- a/boost/spirit/home/x3/operator/optional.hpp
+++ b/boost/spirit/home/x3/operator/optional.hpp
@@ -5,8 +5,8 @@
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
-#if !defined(SPIRIT_OPTIONAL_MARCH_23_2007_1117PM)
-#define SPIRIT_OPTIONAL_MARCH_23_2007_1117PM
+#if !defined(BOOST_SPIRIT_X3_OPTIONAL_MARCH_23_2007_1117PM)
+#define BOOST_SPIRIT_X3_OPTIONAL_MARCH_23_2007_1117PM
#include <boost/spirit/home/x3/core/proxy.hpp>
#include <boost/spirit/home/x3/core/detail/parse_into_container.hpp>
diff --git a/boost/spirit/home/x3/operator/plus.hpp b/boost/spirit/home/x3/operator/plus.hpp
index 152731e622..caf7333892 100644
--- a/boost/spirit/home/x3/operator/plus.hpp
+++ b/boost/spirit/home/x3/operator/plus.hpp
@@ -5,8 +5,8 @@
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
-#if !defined(SPIRIT_PLUS_MARCH_13_2007_0127PM)
-#define SPIRIT_PLUS_MARCH_13_2007_0127PM
+#if !defined(BOOST_SPIRIT_X3_PLUS_MARCH_13_2007_0127PM)
+#define BOOST_SPIRIT_X3_PLUS_MARCH_13_2007_0127PM
#include <boost/spirit/home/x3/core/parser.hpp>
#include <boost/spirit/home/x3/support/traits/container_traits.hpp>
diff --git a/boost/spirit/home/x3/operator/sequence.hpp b/boost/spirit/home/x3/operator/sequence.hpp
index 661a23cd37..ecf7f45e08 100644
--- a/boost/spirit/home/x3/operator/sequence.hpp
+++ b/boost/spirit/home/x3/operator/sequence.hpp
@@ -4,8 +4,8 @@
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
-#if !defined(SPIRIT_SEQUENCE_JAN_06_2013_1015AM)
-#define SPIRIT_SEQUENCE_JAN_06_2013_1015AM
+#if !defined(BOOST_SPIRIT_X3_SEQUENCE_JAN_06_2013_1015AM)
+#define BOOST_SPIRIT_X3_SEQUENCE_JAN_06_2013_1015AM
#include <boost/spirit/home/x3/support/traits/attribute_of.hpp>
#include <boost/spirit/home/x3/core/parser.hpp>