• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 # /* **************************************************************************
2 #  *                                                                          *
3 #  *     (C) Copyright Edward Diener 2014.
4 #  *     Distributed under the Boost Software License, Version 1.0. (See
5 #  *     accompanying file LICENSE_1_0.txt or copy at
6 #  *     http://www.boost.org/LICENSE_1_0.txt)
7 #  *                                                                          *
8 #  ************************************************************************** */
9 #
10 # /* See http://www.boost.org for most recent version. */
11 #
12 # if BOOST_PP_VARIADICS
13 # include <boost/preprocessor/punctuation.hpp>
14 # include <libs/preprocessor/test/test.h>
15 
16 # define A_TUPLE (*,#,zz)
17 # define A_TUPLE2 (*,#,(zz,44,(e7)))
18 # define A_TUPLE_PLUS (mmf,34,^^,!) 456
19 # define PLUS_ATUPLE yyt (j,ii%)
20 # define JDATA ggh
21 # define NOT_TUPLE y6()
22 # define NOT_TUPLE2 &(kkkgg,(e))
23 # define A_SEQ (r)($)(#)
24 # define AN_ARRAY (4,(5,7,f,x))
25 # define A_LIST (e,(g,(&,BOOST_PP_NIL)))
26 # define DATA (5 + 3) * 4
27 # define DATA2 4 * (5 + 3)
28 # define DATA3 4 * (5 + 3) * (2 + 1)
29 # define DATA4 (5 + 3) * (2 + 1) * 4
30 
31 
32 // is_begin_parens
33 
34 BEGIN BOOST_PP_IS_BEGIN_PARENS() == 0 END
35 BEGIN BOOST_PP_IS_BEGIN_PARENS(A_TUPLE) == 1 END
36 BEGIN BOOST_PP_IS_BEGIN_PARENS(A_TUPLE2) == 1 END
37 BEGIN BOOST_PP_IS_BEGIN_PARENS(A_TUPLE_PLUS) == 1 END
38 BEGIN BOOST_PP_IS_BEGIN_PARENS(PLUS_ATUPLE) == 0 END
39 BEGIN BOOST_PP_IS_BEGIN_PARENS(JDATA) == 0 END
40 BEGIN BOOST_PP_IS_BEGIN_PARENS(NOT_TUPLE) == 0 END
41 BEGIN BOOST_PP_IS_BEGIN_PARENS(NOT_TUPLE2) == 0 END
42 BEGIN BOOST_PP_IS_BEGIN_PARENS(A_SEQ) == 1 END
43 BEGIN BOOST_PP_IS_BEGIN_PARENS(AN_ARRAY) == 1 END
44 BEGIN BOOST_PP_IS_BEGIN_PARENS(A_LIST) == 1 END
45 BEGIN BOOST_PP_IS_BEGIN_PARENS((y)2(x)) == 1 END
46 
47 // remove_parens
48 
49 BEGIN BOOST_PP_REMOVE_PARENS(DATA) == 17 END
50 BEGIN BOOST_PP_REMOVE_PARENS(DATA2)== 32 END
51 BEGIN BOOST_PP_REMOVE_PARENS(DATA3)== 96 END
52 BEGIN BOOST_PP_REMOVE_PARENS(DATA4)== 41 END
53 
54 #endif
55