diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2019-12-05 15:24:45 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2019-12-05 15:24:45 +0900 |
commit | 5ce1cfc2525b06c0a9e38531813781de0281c96d (patch) | |
tree | 19cc66c6cf6396db288813b2558cc350f1deede2 /boost/metaparse | |
parent | 3c1df2168531ad5580076ae08d529054689aeedd (diff) | |
download | boost-5ce1cfc2525b06c0a9e38531813781de0281c96d.tar.gz boost-5ce1cfc2525b06c0a9e38531813781de0281c96d.tar.bz2 boost-5ce1cfc2525b06c0a9e38531813781de0281c96d.zip |
Imported Upstream version 1.71.0upstream/1.71.0
Diffstat (limited to 'boost/metaparse')
40 files changed, 1112 insertions, 463 deletions
diff --git a/boost/metaparse/config.hpp b/boost/metaparse/config.hpp index 2e8e6a2931..f1af39e6b9 100644 --- a/boost/metaparse/config.hpp +++ b/boost/metaparse/config.hpp @@ -41,7 +41,15 @@ ) \ && (!defined BOOST_GCC || BOOST_GCC >= 40700) -# define BOOST_METAPARSE_STD 2011 +# if !defined BOOST_NO_CXX14_CONSTEXPR + +# define BOOST_METAPARSE_STD 2014 + +# else + +# define BOOST_METAPARSE_STD 2011 + +# endif # else diff --git a/boost/metaparse/v1/cpp11/impl/any_of_c.hpp b/boost/metaparse/v1/cpp11/impl/any_of_c.hpp new file mode 100644 index 0000000000..fcc3ea3a1c --- /dev/null +++ b/boost/metaparse/v1/cpp11/impl/any_of_c.hpp @@ -0,0 +1,33 @@ +#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_ANY_OF_C_HPP +#define BOOST_METAPARSE_V1_CPP11_IMPL_ANY_OF_C_HPP + +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017. +// 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) + +#include <boost/metaparse/v1/cpp11/impl/or_c.hpp> + +namespace boost +{ + namespace metaparse + { + namespace v1 + { + namespace impl + { + template <char... Cs> + struct any_of_c + { + typedef any_of_c type; + + template <class Chr> + struct apply : or_c<(Chr::type::value == Cs)...> {}; + }; + } + } + } +} + +#endif + diff --git a/boost/metaparse/v1/cpp11/impl/eval_later_result.hpp b/boost/metaparse/v1/cpp11/impl/eval_later_result.hpp new file mode 100644 index 0000000000..e88616dcea --- /dev/null +++ b/boost/metaparse/v1/cpp11/impl/eval_later_result.hpp @@ -0,0 +1,39 @@ +#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_EVAL_LATER_RESULT_HPP +#define BOOST_METAPARSE_V1_CPP11_IMPL_EVAL_LATER_RESULT_HPP + +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017. +// 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) + +#include <boost/metaparse/v1/get_position.hpp> + +#include <boost/mpl/eval_if.hpp> +#include <boost/mpl/less.hpp> + +namespace boost +{ + namespace metaparse + { + namespace v1 + { + namespace impl + { + template <class R1, class R2> + struct eval_later_result : + boost::mpl::eval_if< + typename boost::mpl::less< + typename get_position<R2>::type, + typename get_position<R1>::type + >::type, + R1, + R2 + > + {}; + } + } + } +} + +#endif + diff --git a/boost/metaparse/v1/cpp11/impl/is_none_c.hpp b/boost/metaparse/v1/cpp11/impl/is_none_c.hpp new file mode 100644 index 0000000000..8e3afd6489 --- /dev/null +++ b/boost/metaparse/v1/cpp11/impl/is_none_c.hpp @@ -0,0 +1,33 @@ +#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_IS_NONE_C_HPP +#define BOOST_METAPARSE_V1_CPP11_IMPL_IS_NONE_C_HPP + +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017. +// 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) + +#include <boost/metaparse/v1/cpp11/impl/is_none_c_impl.hpp> + +namespace boost +{ + namespace metaparse + { + namespace v1 + { + namespace impl + { + template <char... Cs> + struct is_none_c + { + typedef is_none_c type; + + template <class C> + struct apply : is_none_c_impl<C::type::value, Cs...> {}; + }; + } + } + } +} + +#endif + diff --git a/boost/metaparse/v1/cpp11/impl/is_none_c_impl.hpp b/boost/metaparse/v1/cpp11/impl/is_none_c_impl.hpp new file mode 100644 index 0000000000..51fe7d878a --- /dev/null +++ b/boost/metaparse/v1/cpp11/impl/is_none_c_impl.hpp @@ -0,0 +1,36 @@ +#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_IS_NONE_C_IMPL_HPP +#define BOOST_METAPARSE_V1_CPP11_IMPL_IS_NONE_C_IMPL_HPP + +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017. +// 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) + +#include <boost/mpl/bool.hpp> + +namespace boost +{ + namespace metaparse + { + namespace v1 + { + namespace impl + { + template <char D, char... Cs> + struct is_none_c_impl; + + template <char D> + struct is_none_c_impl<D> : boost::mpl::bool_<true> {}; + + template <char D, char... Cs> + struct is_none_c_impl<D, D, Cs...> : boost::mpl::bool_<false> {}; + + template <char D, char C, char... Cs> + struct is_none_c_impl<D, C, Cs...> : is_none_c_impl<D, Cs...> {}; + } + } + } +} + +#endif + diff --git a/boost/metaparse/v1/cpp11/impl/or_c.hpp b/boost/metaparse/v1/cpp11/impl/or_c.hpp new file mode 100644 index 0000000000..0e5ce0336f --- /dev/null +++ b/boost/metaparse/v1/cpp11/impl/or_c.hpp @@ -0,0 +1,36 @@ +#ifndef BOOST_METAPARSE_V1_CPP11_OR_C_HPP +#define BOOST_METAPARSE_V1_CPP11_OR_C_HPP + +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017. +// 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) + +#include <boost/mpl/bool.hpp> + +namespace boost +{ + namespace metaparse + { + namespace v1 + { + namespace impl + { + template <bool... Bs> + struct or_c; + + template <> + struct or_c<> : boost::mpl::false_ {}; + + template <bool... Bs> + struct or_c<true, Bs...> : boost::mpl::true_ {}; + + template <bool... Bs> + struct or_c<false, Bs...> : or_c<Bs...> {}; + } + } + } +} + +#endif + diff --git a/boost/metaparse/v1/cpp11/impl/push_front_result.hpp b/boost/metaparse/v1/cpp11/impl/push_front_result.hpp new file mode 100644 index 0000000000..3a11ed7e69 --- /dev/null +++ b/boost/metaparse/v1/cpp11/impl/push_front_result.hpp @@ -0,0 +1,36 @@ +#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_PUSH_FRONT_RESULT_HPP +#define BOOST_METAPARSE_V1_CPP11_IMPL_PUSH_FRONT_RESULT_HPP + +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2018. +// 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) + +#include <boost/metaparse/v1/get_result.hpp> + +#include <boost/mpl/push_front.hpp> + +namespace boost +{ + namespace metaparse + { + namespace v1 + { + namespace impl + { + template <class Value> + struct push_front_result + { + typedef push_front_result type; + + template <class Seq> + struct apply : + boost::mpl::push_front<Seq, typename get_result<Value>::type> + {}; + }; + } + } + } +} + +#endif diff --git a/boost/metaparse/v1/cpp11/impl/remove_trailing_no_chars.hpp b/boost/metaparse/v1/cpp11/impl/remove_trailing_no_chars.hpp deleted file mode 100644 index cdea6e4b7f..0000000000 --- a/boost/metaparse/v1/cpp11/impl/remove_trailing_no_chars.hpp +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_REMOVE_TRAILING_NO_CHARS_HPP -#define BOOST_METAPARSE_V1_CPP11_IMPL_REMOVE_TRAILING_NO_CHARS_HPP - -// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013. -// 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) - -#include <boost/metaparse/v1/cpp11/string.hpp> -#include <boost/metaparse/v1/impl/no_char.hpp> -#include <boost/metaparse/v1/cpp11/impl/push_front_c.hpp> - -namespace boost -{ - namespace metaparse - { - namespace v1 - { - namespace impl - { - template <class S> - struct remove_trailing_no_chars : S {}; - - // this code assumes that BOOST_NO_CHARs are at the end of the string - template <char... Cs> - struct remove_trailing_no_chars<string<BOOST_NO_CHAR, Cs...>> : - string<> - {}; - - template <char C, char... Cs> - struct remove_trailing_no_chars<string<C, Cs...>> : - push_front_c<typename remove_trailing_no_chars<string<Cs...>>::type,C> - {}; - -#ifdef _MSC_VER - /* - * These specialisations are needed to avoid an internal compiler error - * in Visual C++ 12 - */ - template <char C> - struct remove_trailing_no_chars<string<C>> : string<C> {}; - - template <> - struct remove_trailing_no_chars<string<BOOST_NO_CHAR>> : string<> {}; - - template <> - struct remove_trailing_no_chars<string<>> : string<> {}; -#endif - } - } - } -} - -#endif - diff --git a/boost/metaparse/v1/cpp11/impl/string_at.hpp b/boost/metaparse/v1/cpp11/impl/string_at.hpp index 6540d56f65..ea0dfb9e91 100644 --- a/boost/metaparse/v1/cpp11/impl/string_at.hpp +++ b/boost/metaparse/v1/cpp11/impl/string_at.hpp @@ -6,8 +6,6 @@ // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include <boost/metaparse/v1/impl/no_char.hpp> - #include <boost/metaparse/limit_string_size.hpp> namespace boost @@ -19,12 +17,12 @@ namespace boost namespace impl { template <int MaxLen, int Len, class T> - constexpr int string_at(const T (&s)[Len], int n) + constexpr T string_at(const T (&s)[Len], int n) { // "MaxLen + 1" adds the \0 character of the string literal to the // limit static_assert(Len <= MaxLen + 1, "String literal is too long."); - return n >= Len - 1 ? BOOST_NO_CHAR : s[n]; + return n >= Len - 1 ? T() : s[n]; } } } diff --git a/boost/metaparse/v1/cpp11/one_char_except.hpp b/boost/metaparse/v1/cpp11/one_char_except.hpp new file mode 100644 index 0000000000..f7c3a28d19 --- /dev/null +++ b/boost/metaparse/v1/cpp11/one_char_except.hpp @@ -0,0 +1,33 @@ +#ifndef BOOST_METAPARSE_V1_CPP11_ONE_CHAR_EXCEPT_HPP +#define BOOST_METAPARSE_V1_CPP11_ONE_CHAR_EXCEPT_HPP + +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017. +// 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) + +#include <boost/metaparse/v1/error/unexpected_character.hpp> +#include <boost/metaparse/v1/cpp11/impl/is_none_c.hpp> +#include <boost/metaparse/v1/one_char.hpp> +#include <boost/metaparse/v1/accept_when.hpp> + +namespace boost +{ + namespace metaparse + { + namespace v1 + { + template <class... Cs> + struct one_char_except : + accept_when< + one_char, + impl::is_none_c<Cs::type::value...>, + error::unexpected_character + > + {}; + } + } +} + +#endif + diff --git a/boost/metaparse/v1/cpp11/one_char_except_c.hpp b/boost/metaparse/v1/cpp11/one_char_except_c.hpp new file mode 100644 index 0000000000..f1cf2ec84f --- /dev/null +++ b/boost/metaparse/v1/cpp11/one_char_except_c.hpp @@ -0,0 +1,33 @@ +#ifndef BOOST_METAPARSE_V1_CPP11_ONE_CHAR_EXCEPT_C_HPP +#define BOOST_METAPARSE_V1_CPP11_ONE_CHAR_EXCEPT_C_HPP + +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017. +// 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) + +#include <boost/metaparse/v1/error/unexpected_character.hpp> +#include <boost/metaparse/v1/cpp11/impl/is_none_c.hpp> +#include <boost/metaparse/v1/accept_when.hpp> +#include <boost/metaparse/v1/one_char.hpp> + +namespace boost +{ + namespace metaparse + { + namespace v1 + { + template <char... Cs> + struct one_char_except_c : + accept_when< + one_char, + impl::is_none_c<Cs...>, + error::unexpected_character + > + {}; + } + } +} + +#endif + diff --git a/boost/metaparse/v1/cpp11/one_of.hpp b/boost/metaparse/v1/cpp11/one_of.hpp new file mode 100644 index 0000000000..d68eee16ad --- /dev/null +++ b/boost/metaparse/v1/cpp11/one_of.hpp @@ -0,0 +1,56 @@ +#ifndef BOOST_METAPARSE_V1_CPP11_ONE_OF_HPP +#define BOOST_METAPARSE_V1_CPP11_ONE_OF_HPP + +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017. +// 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) + +#include <boost/metaparse/v1/is_error.hpp> +#include <boost/metaparse/v1/fail.hpp> +#include <boost/metaparse/v1/cpp11/impl/eval_later_result.hpp> +#include <boost/metaparse/v1/error/none_of_the_expected_cases_found.hpp> + +#include <boost/mpl/eval_if.hpp> + +namespace boost +{ + namespace metaparse + { + namespace v1 + { + template <class... Ps> + struct one_of; + + template <class P, class... Ps> + struct one_of<P, Ps...> + { + typedef one_of type; + + template <class S, class Pos> + struct apply : + boost::mpl::eval_if< + typename is_error<typename P::template apply<S, Pos>>::type, + boost::mpl::eval_if< + typename is_error< + typename one_of<Ps...>::template apply<S, Pos> + >::type, + impl::eval_later_result< + typename P::template apply<S, Pos>, + typename one_of<Ps...>::template apply<S, Pos> + >, + typename one_of<Ps...>::template apply<S, Pos> + >, + typename P::template apply<S, Pos> + > + {}; + }; + + template <> + struct one_of<> : fail<error::none_of_the_expected_cases_found> {}; + } + } +} + +#endif + diff --git a/boost/metaparse/v1/cpp11/one_of_c.hpp b/boost/metaparse/v1/cpp11/one_of_c.hpp new file mode 100644 index 0000000000..4fa12cf6f4 --- /dev/null +++ b/boost/metaparse/v1/cpp11/one_of_c.hpp @@ -0,0 +1,35 @@ +#ifndef BOOST_METAPARSE_V1_CPP11_ONE_OF_C_HPP +#define BOOST_METAPARSE_V1_CPP11_ONE_OF_C_HPP + +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017. +// 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) + +#include <boost/metaparse/v1/one_char.hpp> +#include <boost/metaparse/v1/accept_when.hpp> +#include <boost/metaparse/v1/error/none_of_the_expected_cases_found.hpp> +#include <boost/metaparse/v1/cpp11/impl/any_of_c.hpp> + +#include <boost/mpl/eval_if.hpp> + +namespace boost +{ + namespace metaparse + { + namespace v1 + { + template <char... Cs> + struct one_of_c : + accept_when< + one_char, + impl::any_of_c<Cs...>, + error::none_of_the_expected_cases_found + > + {}; + } + } +} + +#endif + diff --git a/boost/metaparse/v1/cpp11/repeated_one_of.hpp b/boost/metaparse/v1/cpp11/repeated_one_of.hpp new file mode 100644 index 0000000000..ec788efe1f --- /dev/null +++ b/boost/metaparse/v1/cpp11/repeated_one_of.hpp @@ -0,0 +1,25 @@ +#ifndef BOOST_METAPARSE_V1_CPP11_REPEATED_ONE_OF_HPP +#define BOOST_METAPARSE_V1_CPP11_REPEATED_ONE_OF_HPP + +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017. +// 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) + +#include <boost/metaparse/v1/one_of.hpp> +#include <boost/metaparse/v1/repeated.hpp> + +namespace boost +{ + namespace metaparse + { + namespace v1 + { + template <class... Ps> + using repeated_one_of = repeated<one_of<Ps...>>; + } + } +} + +#endif + diff --git a/boost/metaparse/v1/cpp11/repeated_one_of1.hpp b/boost/metaparse/v1/cpp11/repeated_one_of1.hpp new file mode 100644 index 0000000000..67e2cabefd --- /dev/null +++ b/boost/metaparse/v1/cpp11/repeated_one_of1.hpp @@ -0,0 +1,25 @@ +#ifndef BOOST_METAPARSE_V1_CPP11_REPEATED_ONE_OF1_HPP +#define BOOST_METAPARSE_V1_CPP11_REPEATED_ONE_OF1_HPP + +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017. +// 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) + +#include <boost/metaparse/v1/one_of.hpp> +#include <boost/metaparse/v1/repeated1.hpp> + +namespace boost +{ + namespace metaparse + { + namespace v1 + { + template <class... Ps> + using repeated_one_of1 = repeated1<one_of<Ps...>>; + } + } +} + +#endif + diff --git a/boost/metaparse/v1/cpp11/sequence.hpp b/boost/metaparse/v1/cpp11/sequence.hpp new file mode 100644 index 0000000000..a9f4323783 --- /dev/null +++ b/boost/metaparse/v1/cpp11/sequence.hpp @@ -0,0 +1,62 @@ +#ifndef BOOST_METAPARSE_V1_CPP11_SEQUENCE_HPP +#define BOOST_METAPARSE_V1_CPP11_SEQUENCE_HPP + +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2018. +// 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) + +#include <boost/metaparse/v1/cpp11/impl/push_front_result.hpp> + +#include <boost/metaparse/v1/get_remaining.hpp> +#include <boost/metaparse/v1/get_position.hpp> +#include <boost/metaparse/v1/is_error.hpp> +#include <boost/metaparse/v1/return_.hpp> +#include <boost/metaparse/v1/transform.hpp> + +#include <boost/mpl/eval_if.hpp> +#include <boost/mpl/vector.hpp> + +namespace boost +{ + namespace metaparse + { + namespace v1 + { + template <class... Ps> + struct sequence; + + template <> + struct sequence<> : return_<boost::mpl::vector<>> {}; + + template <class P, class... Ps> + struct sequence<P, Ps...> + { + private: + template <class Res> + struct apply_unchecked : + transform< + sequence<Ps...>, + impl::push_front_result<Res> + >::template apply< + typename get_remaining<Res>::type, + typename get_position<Res>::type + > + {}; + public: + typedef sequence type; + + template <class S, class Pos> + struct apply : + boost::mpl::eval_if< + typename is_error<typename P::template apply<S, Pos>>::type, + typename P::template apply<S, Pos>, + apply_unchecked<typename P::template apply<S, Pos>> + > + {}; + }; + } + } +} + +#endif diff --git a/boost/metaparse/v1/cpp11/string.hpp b/boost/metaparse/v1/cpp11/string.hpp index c2bd95cb19..8dbef5cb2c 100644 --- a/boost/metaparse/v1/cpp11/string.hpp +++ b/boost/metaparse/v1/cpp11/string.hpp @@ -206,8 +206,6 @@ namespace boost } } -#include <boost/metaparse/v1/cpp11/impl/remove_trailing_no_chars.hpp> - #if __clang__ # if __has_extension(cxx_string_literal_templates) # define BOOST_METAPARSE_V1_STRING(...) ::boost::metaparse::string<__VA_ARGS__> diff --git a/boost/metaparse/v1/cpp14/impl/any_of_c.hpp b/boost/metaparse/v1/cpp14/impl/any_of_c.hpp new file mode 100644 index 0000000000..14fede51c4 --- /dev/null +++ b/boost/metaparse/v1/cpp14/impl/any_of_c.hpp @@ -0,0 +1,55 @@ +#ifndef BOOST_METAPARSE_V1_CPP14_IMPL_ANY_OF_C_HPP +#define BOOST_METAPARSE_V1_CPP14_IMPL_ANY_OF_C_HPP + +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017. +// 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) + +#include <boost/mpl/bool.hpp> + +namespace boost +{ + namespace metaparse + { + namespace v1 + { + namespace impl + { + template <char... Cs> + struct any_of_c + { + typedef any_of_c type; + + static constexpr bool run(char c_) + { + const bool values[] = {(c_ == Cs)...}; + for (const bool* i = values; i != values + sizeof...(Cs); ++i) + { + if (*i) + { + return true; + } + } + return false; + } + + template <class Chr> + struct apply : boost::mpl::bool_<any_of_c::run(Chr::type::value)> {}; + }; + + template <> + struct any_of_c<> + { + typedef any_of_c type; + + template <class> + struct apply : boost::mpl::false_ {}; + }; + } + } + } +} + +#endif + diff --git a/boost/metaparse/v1/cpp14/one_of_c.hpp b/boost/metaparse/v1/cpp14/one_of_c.hpp new file mode 100644 index 0000000000..fdfcda0b08 --- /dev/null +++ b/boost/metaparse/v1/cpp14/one_of_c.hpp @@ -0,0 +1,35 @@ +#ifndef BOOST_METAPARSE_V1_CPP14_ONE_OF_C_HPP +#define BOOST_METAPARSE_V1_CPP14_ONE_OF_C_HPP + +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017. +// 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) + +#include <boost/metaparse/v1/one_char.hpp> +#include <boost/metaparse/v1/accept_when.hpp> +#include <boost/metaparse/v1/error/none_of_the_expected_cases_found.hpp> +#include <boost/metaparse/v1/cpp14/impl/any_of_c.hpp> + +#include <boost/mpl/eval_if.hpp> + +namespace boost +{ + namespace metaparse + { + namespace v1 + { + template <char... Cs> + struct one_of_c : + accept_when< + one_char, + impl::any_of_c<Cs...>, + error::none_of_the_expected_cases_found + > + {}; + } + } +} + +#endif + diff --git a/boost/metaparse/v1/impl/is_any.hpp b/boost/metaparse/v1/cpp98/impl/is_none.hpp index 23122b35ce..758658640a 100644 --- a/boost/metaparse/v1/impl/is_any.hpp +++ b/boost/metaparse/v1/cpp98/impl/is_none.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_METAPARSE_V1_IMPL_IS_ANY_HPP -#define BOOST_METAPARSE_V1_IMPL_IS_ANY_HPP +#ifndef BOOST_METAPARSE_V1_CPP98_IMPL_IS_NONE_HPP +#define BOOST_METAPARSE_V1_CPP98_IMPL_IS_NONE_HPP // Copyright Abel Sinkovics (abel@sinkovics.hu) 2013. // Distributed under the Boost Software License, Version 1.0. @@ -25,18 +25,18 @@ namespace boost namespace impl { template <class Stub = int> - struct is_any0 + struct is_none0 { template <class C> struct apply : boost::mpl::true_ {}; }; - #ifdef BOOST_METAPARSE_DEFINE_IS_ANY - # error BOOST_METAPARSE_DEFINE_IS_ANY already defined + #ifdef BOOST_METAPARSE_DEFINE_IS_NONE + # error BOOST_METAPARSE_DEFINE_IS_NONE already defined #endif - #define BOOST_METAPARSE_DEFINE_IS_ANY(z, n, unused) \ + #define BOOST_METAPARSE_DEFINE_IS_NONE(z, n, unused) \ template <BOOST_PP_ENUM_PARAMS(n, class T)> \ - struct BOOST_PP_CAT(is_any, n) \ + struct BOOST_PP_CAT(is_none, n) \ { \ template <class C> \ struct apply : \ @@ -46,7 +46,7 @@ namespace boost == BOOST_PP_CAT(T, BOOST_PP_DEC(n))::type::value \ >, \ boost::mpl::false_, \ - typename BOOST_PP_CAT(is_any, BOOST_PP_DEC(n))< \ + typename BOOST_PP_CAT(is_none, BOOST_PP_DEC(n))< \ BOOST_PP_ENUM_PARAMS(BOOST_PP_DEC(n), T) \ >::template apply<C> \ > \ @@ -56,11 +56,11 @@ namespace boost BOOST_PP_REPEAT_FROM_TO( 1, BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE, - BOOST_METAPARSE_DEFINE_IS_ANY, + BOOST_METAPARSE_DEFINE_IS_NONE, ~ ) - #undef BOOST_METAPARSE_DEFINE_IS_ANY + #undef BOOST_METAPARSE_DEFINE_IS_NONE } } } diff --git a/boost/metaparse/v1/impl/later_result.hpp b/boost/metaparse/v1/cpp98/impl/later_result.hpp index 69c2e5b89a..98afaf12aa 100644 --- a/boost/metaparse/v1/impl/later_result.hpp +++ b/boost/metaparse/v1/cpp98/impl/later_result.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_METAPARSE_V1_IMPL_LATER_RESULT_HPP -#define BOOST_METAPARSE_V1_IMPL_LATER_RESULT_HPP +#ifndef BOOST_METAPARSE_V1_CPP98_IMPL_LATER_RESULT_HPP +#define BOOST_METAPARSE_V1_CPP98_IMPL_LATER_RESULT_HPP // Copyright Abel Sinkovics (abel@sinkovics.hu) 2015. // Distributed under the Boost Software License, Version 1.0. diff --git a/boost/metaparse/v1/impl/one_char_except_not_used.hpp b/boost/metaparse/v1/cpp98/impl/one_char_except_not_used.hpp index 249fcdd725..0bc0781b3f 100644 --- a/boost/metaparse/v1/impl/one_char_except_not_used.hpp +++ b/boost/metaparse/v1/cpp98/impl/one_char_except_not_used.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_METAPARSE_V1_IMPL_ONE_CHAR_EXCEPT_NOT_USED_HPP -#define BOOST_METAPARSE_V1_IMPL_ONE_CHAR_EXCEPT_NOT_USED_HPP +#ifndef BOOST_METAPARSE_V1_CPP98_IMPL_ONE_CHAR_EXCEPT_NOT_USED_HPP +#define BOOST_METAPARSE_V1_CPP98_IMPL_ONE_CHAR_EXCEPT_NOT_USED_HPP // Copyright Abel Sinkovics (abel@sinkovics.hu) 2013. // Distributed under the Boost Software License, Version 1.0. diff --git a/boost/metaparse/v1/impl/one_of.hpp b/boost/metaparse/v1/cpp98/impl/one_of.hpp index e5b53e2e5c..26fa8530e1 100644 --- a/boost/metaparse/v1/impl/one_of.hpp +++ b/boost/metaparse/v1/cpp98/impl/one_of.hpp @@ -9,7 +9,7 @@ #include <boost/metaparse/v1/error/none_of_the_expected_cases_found.hpp> #include <boost/metaparse/v1/fail.hpp> -#include <boost/metaparse/v1/impl/one_of_fwd_op.hpp> +#include <boost/metaparse/v1/cpp98/impl/one_of_fwd_op.hpp> #include <boost/mpl/fold.hpp> diff --git a/boost/metaparse/v1/impl/one_of_fwd_op.hpp b/boost/metaparse/v1/cpp98/impl/one_of_fwd_op.hpp index 97d4658381..a52ec112d6 100644 --- a/boost/metaparse/v1/impl/one_of_fwd_op.hpp +++ b/boost/metaparse/v1/cpp98/impl/one_of_fwd_op.hpp @@ -7,7 +7,7 @@ // http://www.boost.org/LICENSE_1_0.txt) #include <boost/metaparse/v1/is_error.hpp> -#include <boost/metaparse/v1/impl/later_result.hpp> +#include <boost/metaparse/v1/cpp98/impl/later_result.hpp> #include <boost/mpl/eval_if.hpp> diff --git a/boost/metaparse/v1/impl/sequence.hpp b/boost/metaparse/v1/cpp98/impl/sequence.hpp index c500cdf046..7f28766441 100644 --- a/boost/metaparse/v1/impl/sequence.hpp +++ b/boost/metaparse/v1/cpp98/impl/sequence.hpp @@ -1,12 +1,12 @@ -#ifndef BOOST_METAPARSE_V1_IMPL_SEQUENCE_HPP -#define BOOST_METAPARSE_V1_IMPL_SEQUENCE_HPP +#ifndef BOOST_METAPARSE_V1_CPP98_IMPL_SEQUENCE_HPP +#define BOOST_METAPARSE_V1_CPP98_IMPL_SEQUENCE_HPP // Copyright Abel Sinkovics (abel@sinkovics.hu) 2013. // 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) -#include <boost/metaparse/v1/impl/sequence_impl.hpp> +#include <boost/metaparse/v1/cpp98/impl/sequence_impl.hpp> #include <boost/metaparse/limit_sequence_size.hpp> #include <boost/mpl/vector.hpp> diff --git a/boost/metaparse/v1/impl/sequence_impl.hpp b/boost/metaparse/v1/cpp98/impl/sequence_impl.hpp index d3310ed8af..c83ddcd9a1 100644 --- a/boost/metaparse/v1/impl/sequence_impl.hpp +++ b/boost/metaparse/v1/cpp98/impl/sequence_impl.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_METAPARSE_V1_IMPL_SEQUENCE_IMPL_HPP -#define BOOST_METAPARSE_V1_IMPL_SEQUENCE_IMPL_HPP +#ifndef BOOST_METAPARSE_V1_CPP98_IMPL_SEQUENCE_IMPL_HPP +#define BOOST_METAPARSE_V1_CPP98_IMPL_SEQUENCE_IMPL_HPP // Copyright Abel Sinkovics (abel@sinkovics.hu) 2013. // Distributed under the Boost Software License, Version 1.0. diff --git a/boost/metaparse/v1/cpp98/one_char_except.hpp b/boost/metaparse/v1/cpp98/one_char_except.hpp new file mode 100644 index 0000000000..330b593dcd --- /dev/null +++ b/boost/metaparse/v1/cpp98/one_char_except.hpp @@ -0,0 +1,84 @@ +#ifndef BOOST_METAPARSE_V1_CPP98_ONE_CHAR_EXCEPT_HPP +#define BOOST_METAPARSE_V1_CPP98_ONE_CHAR_EXCEPT_HPP + +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2011. +// 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) + +#include <boost/metaparse/v1/error/unexpected_character.hpp> +#include <boost/metaparse/v1/cpp98/impl/is_none.hpp> +#include <boost/metaparse/v1/cpp98/impl/one_char_except_not_used.hpp> +#include <boost/metaparse/v1/one_char.hpp> +#include <boost/metaparse/v1/accept_when.hpp> +#include <boost/metaparse/limit_one_char_except_size.hpp> + +#include <boost/preprocessor/cat.hpp> +#include <boost/preprocessor/arithmetic/dec.hpp> +#include <boost/preprocessor/arithmetic/mul.hpp> +#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> +#include <boost/preprocessor/repetition/repeat.hpp> +#include <boost/preprocessor/repetition/enum.hpp> +#include <boost/preprocessor/punctuation/comma_if.hpp> +#include <boost/preprocessor/tuple/eat.hpp> + +namespace boost +{ + namespace metaparse + { + namespace v1 + { + template < + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE, + class C, + impl::one_char_except_not_used + ) + > + struct one_char_except; + + #ifdef MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE + # error MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE already defined + #endif + #define MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE(z, n, unused) \ + template <BOOST_PP_ENUM_PARAMS(n, class T)> \ + struct one_char_except< \ + BOOST_PP_ENUM_PARAMS(n, T) \ + BOOST_PP_COMMA_IF( \ + BOOST_PP_MUL( \ + n, \ + BOOST_PP_SUB( \ + BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE), \ + n \ + ) \ + ) \ + ) \ + BOOST_PP_ENUM( \ + BOOST_PP_SUB( \ + BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE), \ + n \ + ), \ + impl::one_char_except_not_used BOOST_PP_TUPLE_EAT(3), \ + ~ \ + ) \ + > :\ + accept_when< \ + one_char, \ + impl::BOOST_PP_CAT(is_none, n)<BOOST_PP_ENUM_PARAMS(n, T)>, \ + error::unexpected_character \ + > \ + {}; + + BOOST_PP_REPEAT( + BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE, + MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE, + ~ + ) + + #undef MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE + } + } +} + +#endif + diff --git a/boost/metaparse/v1/cpp98/one_char_except_c.hpp b/boost/metaparse/v1/cpp98/one_char_except_c.hpp new file mode 100644 index 0000000000..5556039a65 --- /dev/null +++ b/boost/metaparse/v1/cpp98/one_char_except_c.hpp @@ -0,0 +1,96 @@ +#ifndef BOOST_METAPARSE_V1_CPP98_ONE_CHAR_EXCEPT_C_HPP +#define BOOST_METAPARSE_V1_CPP98_ONE_CHAR_EXCEPT_C_HPP + +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2011. +// 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) + +#include <boost/metaparse/limit_one_char_except_size.hpp> +#include <boost/metaparse/v1/error/unexpected_character.hpp> +#include <boost/metaparse/v1/cpp98/impl/is_none.hpp> +#include <boost/metaparse/v1/accept_when.hpp> +#include <boost/metaparse/v1/one_char.hpp> + +#include <boost/mpl/char.hpp> + +#include <boost/preprocessor/cat.hpp> +#include <boost/preprocessor/arithmetic/sub.hpp> +#include <boost/preprocessor/arithmetic/mul.hpp> +#include <boost/preprocessor/arithmetic/dec.hpp> +#include <boost/preprocessor/repetition/repeat.hpp> +#include <boost/preprocessor/repetition/enum.hpp> +#include <boost/preprocessor/repetition/enum_params.hpp> +#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> +#include <boost/preprocessor/punctuation/comma_if.hpp> +#include <boost/preprocessor/tuple/eat.hpp> + +namespace boost +{ + namespace metaparse + { + namespace v1 + { + template < + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE, + int C, + 1024 + ) + > + struct one_char_except_c; + + #ifdef BOOST_METAPARSE_WRAP + # error BOOST_METAPARSE_WRAP already defined + #endif + #define BOOST_METAPARSE_WRAP(z, n, unused) \ + boost::mpl::char_<BOOST_PP_CAT(C, n)> + + #ifdef MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE + # error MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE already defined + #endif + #define MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE(z, n, unused) \ + template <BOOST_PP_ENUM_PARAMS(n, int C)> \ + struct one_char_except_c< \ + BOOST_PP_ENUM_PARAMS(n, C) \ + BOOST_PP_COMMA_IF( \ + BOOST_PP_MUL( \ + n, \ + BOOST_PP_SUB( \ + BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE), \ + n \ + )\ + ) \ + ) \ + BOOST_PP_ENUM( \ + BOOST_PP_SUB( \ + BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE), \ + n \ + ), \ + 1024 BOOST_PP_TUPLE_EAT(3), \ + ~ \ + ) \ + > : \ + accept_when< \ + one_char, \ + impl::BOOST_PP_CAT(is_none, n)< \ + BOOST_PP_ENUM(n, BOOST_METAPARSE_WRAP, ~) \ + >, \ + error::unexpected_character \ + > \ + {}; + + BOOST_PP_REPEAT( + BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE, + MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE, + ~ + ) + + #undef MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE + #undef BOOST_METAPARSE_WRAP + } + } +} + +#endif + diff --git a/boost/metaparse/v1/cpp98/one_of.hpp b/boost/metaparse/v1/cpp98/one_of.hpp new file mode 100644 index 0000000000..d40b8ff085 --- /dev/null +++ b/boost/metaparse/v1/cpp98/one_of.hpp @@ -0,0 +1,42 @@ +#ifndef BOOST_METAPARSE_V1_CPP98_ONE_OF_HPP +#define BOOST_METAPARSE_V1_CPP98_ONE_OF_HPP + +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2009 - 2010. +// 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) + +#include <boost/metaparse/v1/cpp98/impl/one_of.hpp> +#include <boost/metaparse/limit_one_of_size.hpp> + +#include <boost/mpl/vector.hpp> + +#include <boost/preprocessor/repetition/enum_params.hpp> +#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> + +namespace boost +{ + namespace metaparse + { + namespace v1 + { + template < + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + BOOST_METAPARSE_LIMIT_ONE_OF_SIZE, + class P, + boost::mpl::na + ) + > + struct one_of : + impl::one_of< + boost::mpl::vector< + BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_ONE_OF_SIZE, P) + > + > + {}; + } + } +} + +#endif + diff --git a/boost/metaparse/v1/cpp98/one_of_c.hpp b/boost/metaparse/v1/cpp98/one_of_c.hpp new file mode 100644 index 0000000000..9a13a331bf --- /dev/null +++ b/boost/metaparse/v1/cpp98/one_of_c.hpp @@ -0,0 +1,81 @@ +#ifndef BOOST_METAPARSE_V1_CPP98_ONE_OF_C_HPP +#define BOOST_METAPARSE_V1_CPP98_ONE_OF_C_HPP + +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013. +// 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) + +#include <boost/metaparse/v1/one_of.hpp> +#include <boost/metaparse/v1/lit_c.hpp> +#include <boost/metaparse/limit_one_of_size.hpp> + +#include <boost/preprocessor/arithmetic/sub.hpp> +#include <boost/preprocessor/cat.hpp> +#include <boost/preprocessor/punctuation/comma_if.hpp> +#include <boost/preprocessor/repetition/enum.hpp> +#include <boost/preprocessor/repetition/enum_params.hpp> +#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> +#include <boost/preprocessor/repetition/repeat.hpp> +#include <boost/preprocessor/tuple/eat.hpp> + +#include <climits> + +namespace boost +{ + namespace metaparse + { + namespace v1 + { + #ifdef BOOST_NO_SCALAR_VALUE + # error BOOST_NO_SCALAR_VALUE already defined + #endif + #define BOOST_NO_SCALAR_VALUE LONG_MAX + + template < + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + BOOST_METAPARSE_LIMIT_ONE_OF_SIZE, + long C, + BOOST_NO_SCALAR_VALUE + ) + > + struct one_of_c; + + #ifdef BOOST_METAPARSE_ONE_OF_C_LIT + # error BOOST_METAPARSE_ONE_OF_C_LIT already defined + #endif + #define BOOST_METAPARSE_ONE_OF_C_LIT(z, n, unused) lit_c<BOOST_PP_CAT(C, n)> + + #ifdef BOOST_METAPARSE_ONE_OF_C_CASE + # error BOOST_METAPARSE_ONE_OF_C_CASE already defined + #endif + #define BOOST_METAPARSE_ONE_OF_C_CASE(z, n, unused) \ + template <BOOST_PP_ENUM_PARAMS(n, long C)> \ + struct \ + one_of_c< \ + BOOST_PP_ENUM_PARAMS(n, C) \ + BOOST_PP_COMMA_IF(n) \ + BOOST_PP_ENUM( \ + BOOST_PP_SUB(BOOST_METAPARSE_LIMIT_ONE_OF_SIZE, n), \ + BOOST_NO_SCALAR_VALUE BOOST_PP_TUPLE_EAT(3), \ + ~ \ + ) \ + > : \ + one_of< BOOST_PP_ENUM(n, BOOST_METAPARSE_ONE_OF_C_LIT, ~) > \ + {}; + + BOOST_PP_REPEAT( + BOOST_METAPARSE_LIMIT_ONE_OF_SIZE, + BOOST_METAPARSE_ONE_OF_C_CASE, + ~ + ) + + #undef BOOST_METAPARSE_ONE_OF_C_CASE + #undef BOOST_METAPARSE_ONE_OF_C_LIT + #undef BOOST_NO_SCALAR_VALUE + } + } +} + +#endif + diff --git a/boost/metaparse/v1/cpp98/repeated_one_of.hpp b/boost/metaparse/v1/cpp98/repeated_one_of.hpp new file mode 100644 index 0000000000..eb874dfd39 --- /dev/null +++ b/boost/metaparse/v1/cpp98/repeated_one_of.hpp @@ -0,0 +1,45 @@ +#ifndef BOOST_METAPARSE_V1_CPP98_REPEATED_ONE_OF_HPP +#define BOOST_METAPARSE_V1_CPP98_REPEATED_ONE_OF_HPP + +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2010. +// 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) + +#include <boost/metaparse/limit_one_of_size.hpp> +#include <boost/metaparse/v1/cpp98/impl/one_of.hpp> +#include <boost/metaparse/v1/repeated.hpp> + +#include <boost/mpl/vector.hpp> + +#include <boost/preprocessor/repetition/enum_params.hpp> +#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> + +namespace boost +{ + namespace metaparse + { + namespace v1 + { + template < + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + BOOST_METAPARSE_LIMIT_ONE_OF_SIZE, + class P, + boost::mpl::na + ) + > + struct repeated_one_of : + repeated< + impl::one_of< + boost::mpl::vector< + BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_ONE_OF_SIZE, P) + > + > + > + {}; + } + } +} + +#endif + diff --git a/boost/metaparse/v1/cpp98/repeated_one_of1.hpp b/boost/metaparse/v1/cpp98/repeated_one_of1.hpp new file mode 100644 index 0000000000..abda799b7d --- /dev/null +++ b/boost/metaparse/v1/cpp98/repeated_one_of1.hpp @@ -0,0 +1,45 @@ +#ifndef BOOST_METAPARSE_V1_CPP98_REPEATED_ONE_OF1_HPP +#define BOOST_METAPARSE_V1_CPP98_REPEATED_ONE_OF1_HPP + +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2010. +// 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) + +#include <boost/metaparse/limit_one_of_size.hpp> +#include <boost/metaparse/v1/cpp98/impl/one_of.hpp> +#include <boost/metaparse/v1/repeated1.hpp> + +#include <boost/mpl/vector.hpp> + +#include <boost/preprocessor/repetition/enum_params.hpp> +#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> + +namespace boost +{ + namespace metaparse + { + namespace v1 + { + template < + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + BOOST_METAPARSE_LIMIT_ONE_OF_SIZE, + class P, + boost::mpl::na + ) + > + struct repeated_one_of1 : + repeated1< + impl::one_of< + boost::mpl::vector< + BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_ONE_OF_SIZE, P) + > + > + > + {}; + } + } +} + +#endif + diff --git a/boost/metaparse/v1/cpp98/sequence.hpp b/boost/metaparse/v1/cpp98/sequence.hpp new file mode 100644 index 0000000000..6aae835801 --- /dev/null +++ b/boost/metaparse/v1/cpp98/sequence.hpp @@ -0,0 +1,64 @@ +#ifndef BOOST_METAPARSE_V1_CPP98_SEQUENCE_HPP +#define BOOST_METAPARSE_V1_CPP98_SEQUENCE_HPP + +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2009 - 2010. +// 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) + +#include <boost/metaparse/v1/cpp98/impl/sequence.hpp> + +#include <boost/preprocessor/comma_if.hpp> +#include <boost/preprocessor/repetition/repeat_from_to.hpp> +#include <boost/preprocessor/repetition/enum.hpp> +#include <boost/preprocessor/repetition/enum_params.hpp> +#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> +#include <boost/preprocessor/arithmetic/sub.hpp> +#include <boost/preprocessor/cat.hpp> +#include <boost/preprocessor/tuple/eat.hpp> + +namespace boost +{ + namespace metaparse + { + namespace v1 + { + template < + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE, + class P, + boost::mpl::na + ) + > + struct sequence; + + #ifdef BOOST_METAPARSE_SEQUENCE_N + # error BOOST_METAPARSE_SEQUENCE_N already defined + #endif + #define BOOST_METAPARSE_SEQUENCE_N(z, n, unused) \ + template <BOOST_PP_ENUM_PARAMS(n, class P)> \ + struct sequence< \ + BOOST_PP_ENUM_PARAMS(n, P) \ + BOOST_PP_COMMA_IF(n) \ + BOOST_PP_ENUM( \ + BOOST_PP_SUB(BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE, n), \ + boost::mpl::na BOOST_PP_TUPLE_EAT(3), \ + ~ \ + ) \ + > : impl::BOOST_PP_CAT(sequence, n)<BOOST_PP_ENUM_PARAMS(n, P)> \ + {}; + + BOOST_PP_REPEAT_FROM_TO( + 1, + BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE, + BOOST_METAPARSE_SEQUENCE_N, + ~ + ) + + #undef BOOST_METAPARSE_SEQUENCE_N + } + } +} + +#endif + diff --git a/boost/metaparse/v1/one_char_except.hpp b/boost/metaparse/v1/one_char_except.hpp index c859ab23f3..266d8d720a 100644 --- a/boost/metaparse/v1/one_char_except.hpp +++ b/boost/metaparse/v1/one_char_except.hpp @@ -1,85 +1,18 @@ #ifndef BOOST_METAPARSE_V1_ONE_CHAR_EXCEPT_HPP #define BOOST_METAPARSE_V1_ONE_CHAR_EXCEPT_HPP -// Copyright Abel Sinkovics (abel@sinkovics.hu) 2011. +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017. // 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) -#include <boost/metaparse/v1/error/unexpected_character.hpp> -#include <boost/metaparse/v1/impl/is_any.hpp> -#include <boost/metaparse/v1/impl/one_char_except_not_used.hpp> -#include <boost/metaparse/v1/one_char.hpp> -#include <boost/metaparse/v1/accept_when.hpp> -#include <boost/metaparse/v1/define_error.hpp> -#include <boost/metaparse/limit_one_char_except_size.hpp> +#include <boost/metaparse/config.hpp> -#include <boost/preprocessor/cat.hpp> -#include <boost/preprocessor/arithmetic/dec.hpp> -#include <boost/preprocessor/arithmetic/mul.hpp> -#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> -#include <boost/preprocessor/repetition/repeat.hpp> -#include <boost/preprocessor/repetition/enum.hpp> -#include <boost/preprocessor/punctuation/comma_if.hpp> -#include <boost/preprocessor/tuple/eat.hpp> - -namespace boost -{ - namespace metaparse - { - namespace v1 - { - template < - BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( - BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE, - class C, - impl::one_char_except_not_used - ) - > - struct one_char_except; - - #ifdef MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE - # error MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE already defined - #endif - #define MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE(z, n, unused) \ - template <BOOST_PP_ENUM_PARAMS(n, class T)> \ - struct one_char_except< \ - BOOST_PP_ENUM_PARAMS(n, T) \ - BOOST_PP_COMMA_IF( \ - BOOST_PP_MUL( \ - n, \ - BOOST_PP_SUB( \ - BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE), \ - n \ - ) \ - ) \ - ) \ - BOOST_PP_ENUM( \ - BOOST_PP_SUB( \ - BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE), \ - n \ - ), \ - impl::one_char_except_not_used BOOST_PP_TUPLE_EAT(3), \ - ~ \ - ) \ - > :\ - accept_when< \ - one_char, \ - impl::BOOST_PP_CAT(is_any, n)<BOOST_PP_ENUM_PARAMS(n, T)>, \ - error::unexpected_character \ - > \ - {}; - - BOOST_PP_REPEAT( - BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE, - MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE, - ~ - ) - - #undef MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE - } - } -} +#if BOOST_METAPARSE_STD >= 2011 +# include <boost/metaparse/v1/cpp11/one_char_except.hpp> +#else +# include <boost/metaparse/v1/cpp98/one_char_except.hpp> +#endif #endif diff --git a/boost/metaparse/v1/one_char_except_c.hpp b/boost/metaparse/v1/one_char_except_c.hpp index 780cb5924f..0c12a2a323 100644 --- a/boost/metaparse/v1/one_char_except_c.hpp +++ b/boost/metaparse/v1/one_char_except_c.hpp @@ -1,96 +1,18 @@ #ifndef BOOST_METAPARSE_V1_ONE_CHAR_EXCEPT_C_HPP #define BOOST_METAPARSE_V1_ONE_CHAR_EXCEPT_C_HPP -// Copyright Abel Sinkovics (abel@sinkovics.hu) 2011. +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017. // 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) -#include <boost/metaparse/limit_one_char_except_size.hpp> -#include <boost/metaparse/v1/error/unexpected_character.hpp> -#include <boost/metaparse/v1/impl/is_any.hpp> -#include <boost/metaparse/v1/accept_when.hpp> -#include <boost/metaparse/v1/one_char.hpp> +#include <boost/metaparse/config.hpp> -#include <boost/mpl/char.hpp> - -#include <boost/preprocessor/cat.hpp> -#include <boost/preprocessor/arithmetic/sub.hpp> -#include <boost/preprocessor/arithmetic/mul.hpp> -#include <boost/preprocessor/arithmetic/dec.hpp> -#include <boost/preprocessor/repetition/repeat.hpp> -#include <boost/preprocessor/repetition/enum.hpp> -#include <boost/preprocessor/repetition/enum_params.hpp> -#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> -#include <boost/preprocessor/punctuation/comma_if.hpp> -#include <boost/preprocessor/tuple/eat.hpp> - -namespace boost -{ - namespace metaparse - { - namespace v1 - { - template < - BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( - BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE, - int C, - 1024 - ) - > - struct one_char_except_c; - - #ifdef BOOST_METAPARSE_WRAP - # error BOOST_METAPARSE_WRAP already defined - #endif - #define BOOST_METAPARSE_WRAP(z, n, unused) \ - boost::mpl::char_<BOOST_PP_CAT(C, n)> - - #ifdef MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE - # error MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE already defined - #endif - #define MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE(z, n, unused) \ - template <BOOST_PP_ENUM_PARAMS(n, int C)> \ - struct one_char_except_c< \ - BOOST_PP_ENUM_PARAMS(n, C) \ - BOOST_PP_COMMA_IF( \ - BOOST_PP_MUL( \ - n, \ - BOOST_PP_SUB( \ - BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE), \ - n \ - )\ - ) \ - ) \ - BOOST_PP_ENUM( \ - BOOST_PP_SUB( \ - BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE), \ - n \ - ), \ - 1024 BOOST_PP_TUPLE_EAT(3), \ - ~ \ - ) \ - > : \ - accept_when< \ - one_char, \ - impl::BOOST_PP_CAT(is_any, n)< \ - BOOST_PP_ENUM(n, BOOST_METAPARSE_WRAP, ~) \ - >, \ - error::unexpected_character \ - > \ - {}; - - BOOST_PP_REPEAT( - BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE, - MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE, - ~ - ) - - #undef MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE - #undef BOOST_METAPARSE_WRAP - } - } -} +#if BOOST_METAPARSE_STD >= 2011 +# include <boost/metaparse/v1/cpp11/one_char_except_c.hpp> +#else +# include <boost/metaparse/v1/cpp98/one_char_except_c.hpp> +#endif #endif diff --git a/boost/metaparse/v1/one_of.hpp b/boost/metaparse/v1/one_of.hpp index d48db4c4c0..409d58d992 100644 --- a/boost/metaparse/v1/one_of.hpp +++ b/boost/metaparse/v1/one_of.hpp @@ -1,42 +1,18 @@ #ifndef BOOST_METAPARSE_V1_ONE_OF_HPP #define BOOST_METAPARSE_V1_ONE_OF_HPP -// Copyright Abel Sinkovics (abel@sinkovics.hu) 2009 - 2010. +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017. // 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) -#include <boost/metaparse/v1/impl/one_of.hpp> -#include <boost/metaparse/limit_one_of_size.hpp> +#include <boost/metaparse/config.hpp> -#include <boost/mpl/vector.hpp> - -#include <boost/preprocessor/repetition/enum_params.hpp> -#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> - -namespace boost -{ - namespace metaparse - { - namespace v1 - { - template < - BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( - BOOST_METAPARSE_LIMIT_ONE_OF_SIZE, - class P, - boost::mpl::na - ) - > - struct one_of : - impl::one_of< - boost::mpl::vector< - BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_ONE_OF_SIZE, P) - > - > - {}; - } - } -} +#if BOOST_METAPARSE_STD >= 2011 +# include <boost/metaparse/v1/cpp11/one_of.hpp> +#else +# include <boost/metaparse/v1/cpp98/one_of.hpp> +#endif #endif diff --git a/boost/metaparse/v1/one_of_c.hpp b/boost/metaparse/v1/one_of_c.hpp index ff7251a4e0..1f0e378d69 100644 --- a/boost/metaparse/v1/one_of_c.hpp +++ b/boost/metaparse/v1/one_of_c.hpp @@ -1,80 +1,20 @@ #ifndef BOOST_METAPARSE_V1_ONE_OF_C_HPP #define BOOST_METAPARSE_V1_ONE_OF_C_HPP -// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013. +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017. // 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) -#include <boost/metaparse/v1/one_of.hpp> -#include <boost/metaparse/v1/lit_c.hpp> +#include <boost/metaparse/config.hpp> -#include <boost/preprocessor/arithmetic/sub.hpp> -#include <boost/preprocessor/cat.hpp> -#include <boost/preprocessor/punctuation/comma_if.hpp> -#include <boost/preprocessor/repetition/enum.hpp> -#include <boost/preprocessor/repetition/enum_params.hpp> -#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> -#include <boost/preprocessor/repetition/repeat.hpp> -#include <boost/preprocessor/tuple/eat.hpp> - -#include <climits> - -namespace boost -{ - namespace metaparse - { - namespace v1 - { - #ifdef BOOST_NO_SCALAR_VALUE - # error BOOST_NO_SCALAR_VALUE already defined - #endif - #define BOOST_NO_SCALAR_VALUE LONG_MAX - - template < - BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( - BOOST_METAPARSE_LIMIT_ONE_OF_SIZE, - long C, - BOOST_NO_SCALAR_VALUE - ) - > - struct one_of_c; - - #ifdef BOOST_METAPARSE_ONE_OF_C_LIT - # error BOOST_METAPARSE_ONE_OF_C_LIT already defined - #endif - #define BOOST_METAPARSE_ONE_OF_C_LIT(z, n, unused) lit_c<BOOST_PP_CAT(C, n)> - - #ifdef BOOST_METAPARSE_ONE_OF_C_CASE - # error BOOST_METAPARSE_ONE_OF_C_CASE already defined - #endif - #define BOOST_METAPARSE_ONE_OF_C_CASE(z, n, unused) \ - template <BOOST_PP_ENUM_PARAMS(n, long C)> \ - struct \ - one_of_c< \ - BOOST_PP_ENUM_PARAMS(n, C) \ - BOOST_PP_COMMA_IF(n) \ - BOOST_PP_ENUM( \ - BOOST_PP_SUB(BOOST_METAPARSE_LIMIT_ONE_OF_SIZE, n), \ - BOOST_NO_SCALAR_VALUE BOOST_PP_TUPLE_EAT(3), \ - ~ \ - ) \ - > : \ - one_of< BOOST_PP_ENUM(n, BOOST_METAPARSE_ONE_OF_C_LIT, ~) > \ - {}; - - BOOST_PP_REPEAT( - BOOST_METAPARSE_LIMIT_ONE_OF_SIZE, - BOOST_METAPARSE_ONE_OF_C_CASE, - ~ - ) - - #undef BOOST_METAPARSE_ONE_OF_C_CASE - #undef BOOST_METAPARSE_ONE_OF_C_LIT - #undef BOOST_NO_SCALAR_VALUE - } - } -} +#if BOOST_METAPARSE_STD >= 2014 +# include <boost/metaparse/v1/cpp14/one_of_c.hpp> +#elif BOOST_METAPARSE_STD >= 2011 +# include <boost/metaparse/v1/cpp11/one_of_c.hpp> +#else +# include <boost/metaparse/v1/cpp98/one_of_c.hpp> +#endif #endif diff --git a/boost/metaparse/v1/repeated_one_of.hpp b/boost/metaparse/v1/repeated_one_of.hpp index 3296030b62..39bc03162b 100644 --- a/boost/metaparse/v1/repeated_one_of.hpp +++ b/boost/metaparse/v1/repeated_one_of.hpp @@ -1,45 +1,18 @@ #ifndef BOOST_METAPARSE_V1_REPEATED_ONE_OF_HPP #define BOOST_METAPARSE_V1_REPEATED_ONE_OF_HPP -// Copyright Abel Sinkovics (abel@sinkovics.hu) 2010. +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017. // 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) -#include <boost/metaparse/limit_one_of_size.hpp> -#include <boost/metaparse/v1/impl/one_of.hpp> -#include <boost/metaparse/v1/repeated.hpp> +#include <boost/metaparse/config.hpp> -#include <boost/mpl/vector.hpp> - -#include <boost/preprocessor/repetition/enum_params.hpp> -#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> - -namespace boost -{ - namespace metaparse - { - namespace v1 - { - template < - BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( - BOOST_METAPARSE_LIMIT_ONE_OF_SIZE, - class P, - boost::mpl::na - ) - > - struct repeated_one_of : - repeated< - impl::one_of< - boost::mpl::vector< - BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_ONE_OF_SIZE, P) - > - > - > - {}; - } - } -} +#if BOOST_METAPARSE_STD >= 2011 +# include <boost/metaparse/v1/cpp11/repeated_one_of.hpp> +#else +# include <boost/metaparse/v1/cpp98/repeated_one_of.hpp> +#endif #endif diff --git a/boost/metaparse/v1/repeated_one_of1.hpp b/boost/metaparse/v1/repeated_one_of1.hpp index 2d305d2abd..a886c77edf 100644 --- a/boost/metaparse/v1/repeated_one_of1.hpp +++ b/boost/metaparse/v1/repeated_one_of1.hpp @@ -1,45 +1,18 @@ #ifndef BOOST_METAPARSE_V1_REPEATED_ONE_OF1_HPP #define BOOST_METAPARSE_V1_REPEATED_ONE_OF1_HPP -// Copyright Abel Sinkovics (abel@sinkovics.hu) 2010. +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017. // 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) -#include <boost/metaparse/limit_one_of_size.hpp> -#include <boost/metaparse/v1/impl/one_of.hpp> -#include <boost/metaparse/v1/repeated1.hpp> +#include <boost/metaparse/config.hpp> -#include <boost/mpl/vector.hpp> - -#include <boost/preprocessor/repetition/enum_params.hpp> -#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> - -namespace boost -{ - namespace metaparse - { - namespace v1 - { - template < - BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( - BOOST_METAPARSE_LIMIT_ONE_OF_SIZE, - class P, - boost::mpl::na - ) - > - struct repeated_one_of1 : - repeated1< - impl::one_of< - boost::mpl::vector< - BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_ONE_OF_SIZE, P) - > - > - > - {}; - } - } -} +#if BOOST_METAPARSE_STD >= 2011 +# include <boost/metaparse/v1/cpp11/repeated_one_of1.hpp> +#else +# include <boost/metaparse/v1/cpp98/repeated_one_of1.hpp> +#endif #endif diff --git a/boost/metaparse/v1/sequence.hpp b/boost/metaparse/v1/sequence.hpp index f25c632fbd..0e4845d399 100644 --- a/boost/metaparse/v1/sequence.hpp +++ b/boost/metaparse/v1/sequence.hpp @@ -1,64 +1,18 @@ #ifndef BOOST_METAPARSE_V1_SEQUENCE_HPP #define BOOST_METAPARSE_V1_SEQUENCE_HPP -// Copyright Abel Sinkovics (abel@sinkovics.hu) 2009 - 2010. +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2018. // 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) -#include <boost/metaparse/v1/impl/sequence.hpp> +#include <boost/metaparse/config.hpp> -#include <boost/preprocessor/comma_if.hpp> -#include <boost/preprocessor/repetition/repeat_from_to.hpp> -#include <boost/preprocessor/repetition/enum.hpp> -#include <boost/preprocessor/repetition/enum_params.hpp> -#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> -#include <boost/preprocessor/arithmetic/sub.hpp> -#include <boost/preprocessor/cat.hpp> -#include <boost/preprocessor/tuple/eat.hpp> - -namespace boost -{ - namespace metaparse - { - namespace v1 - { - template < - BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( - BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE, - class P, - boost::mpl::na - ) - > - struct sequence; - - #ifdef BOOST_METAPARSE_SEQUENCE_N - # error BOOST_METAPARSE_SEQUENCE_N already defined - #endif - #define BOOST_METAPARSE_SEQUENCE_N(z, n, unused) \ - template <BOOST_PP_ENUM_PARAMS(n, class P)> \ - struct sequence< \ - BOOST_PP_ENUM_PARAMS(n, P) \ - BOOST_PP_COMMA_IF(n) \ - BOOST_PP_ENUM( \ - BOOST_PP_SUB(BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE, n), \ - boost::mpl::na BOOST_PP_TUPLE_EAT(3), \ - ~ \ - ) \ - > : impl::BOOST_PP_CAT(sequence, n)<BOOST_PP_ENUM_PARAMS(n, P)> \ - {}; - - BOOST_PP_REPEAT_FROM_TO( - 1, - BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE, - BOOST_METAPARSE_SEQUENCE_N, - ~ - ) - - #undef BOOST_METAPARSE_SEQUENCE_N - } - } -} +#if BOOST_METAPARSE_STD >= 2011 +# include <boost/metaparse/v1/cpp11/sequence.hpp> +#else +# include <boost/metaparse/v1/cpp98/sequence.hpp> +#endif #endif |