#include <boost/spirit/home/x3/core/parser.hpp>
#include <boost/spirit/home/x3/core/skip_over.hpp>
#include <boost/spirit/home/x3/directive/expect.hpp>
-#include <boost/spirit/home/x3/support/traits/make_attribute.hpp>
#include <boost/spirit/home/x3/support/utility/sfinae.hpp>
#include <boost/spirit/home/x3/nonterminal/detail/transform_attribute.hpp>
#include <boost/utility/addressof.hpp>
#include <boost/spirit/home/x3/nonterminal/simple_trace.hpp>
#endif
+#include <type_traits>
+
namespace boost { namespace spirit { namespace x3
{
template <typename ID>
typedef
decltype(parse_rule(
rule<ID, Attribute>(), first, last
- , make_unique_context<ID>(rhs, context), attr))
+ , make_unique_context<ID>(rhs, context), std::declval<Attribute&>()))
parse_rule_result;
// If there is no BOOST_SPIRIT_DEFINE for this rule,
{
boost::ignore_unused(rule_name);
- typedef traits::make_attribute<Attribute, ActualAttribute> make_attribute;
-
// do down-stream transformation, provides attribute for
// rhs parser
typedef traits::transform_attribute<
- typename make_attribute::type, Attribute, parser_id>
+ ActualAttribute, Attribute, parser_id>
transform;
- typedef typename make_attribute::value_type value_type;
typedef typename transform::type transform_attr;
- value_type made_attr = make_attribute::call(attr);
- transform_attr attr_ = transform::pre(made_attr);
+ transform_attr attr_ = transform::pre(attr);
bool ok_parse
//Creates a place to hold the result of parse_rhs
// the #if...#endif) to call it's DTOR before any
// modifications are made to the attribute, attr_ passed
// to parse_rhs (such as might be done in
- // traits::post_transform when, for example,
+ // transform::post when, for example,
// ActualAttribute is a recursive variant).
#if defined(BOOST_SPIRIT_X3_DEBUG)
context_debug<Iterator, transform_attr>
{
// do up-stream transformation, this integrates the results
// back into the original attribute value, if appropriate
- traits::post_transform(attr, std::forward<transform_attr>(attr_));
+ transform::post(attr, std::forward<transform_attr>(attr_));
}
return ok_parse;
}