Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83221 - in sandbox/contract: boost boost/contract/detail/preprocessor/array boost/contract/detail/preprocessor/facilities boost/contract/detail/preprocessor/traits/aux_ boost/contract/detail/preprocessor/traits/func boost/contract/detail/preprocessor/tuple libs/contract/example/contracts libs/contract/generate libs/contract/generate/boost libs/contract/generate/boost/contract libs/contract/generate/boost/contract/detail libs/contract/generate/boost/contract/detail/preprocessor libs/contract/generate/boost/contract/detail/preprocessor/array libs/contract/generate/boost/contract/detail/preprocessor/facilities libs/contract/generate/boost/contract/detail/preprocessor/traits libs/contract/generate/boost/contract/detail/preprocessor/traits/aux_ libs/contract/generate/boost/contract/detail/preprocessor/traits/func libs/contract/generate/boost/contract/detail/preprocessor/tuple
From: lorcaminiti_at_[hidden]
Date: 2013-02-28 19:11:36


Author: lcaminiti
Date: 2013-02-28 19:11:34 EST (Thu, 28 Feb 2013)
New Revision: 83221
URL: http://svn.boost.org/trac/boost/changeset/83221

Log:
Moved *-generate.py scripts into libs/contract/generate/.
Added:
   sandbox/contract/libs/contract/generate/
   sandbox/contract/libs/contract/generate/boost/
   sandbox/contract/libs/contract/generate/boost/contract/
   sandbox/contract/libs/contract/generate/boost/contract/detail/
   sandbox/contract/libs/contract/generate/boost/contract/detail/preprocessor/
   sandbox/contract/libs/contract/generate/boost/contract/detail/preprocessor/array/
   sandbox/contract/libs/contract/generate/boost/contract/detail/preprocessor/array/first_n-generate.py
      - copied unchanged from r83214, /sandbox/contract/boost/contract/detail/preprocessor/array/first_n-generate.py
   sandbox/contract/libs/contract/generate/boost/contract/detail/preprocessor/array/rest_n-generate.py
      - copied unchanged from r83214, /sandbox/contract/boost/contract/detail/preprocessor/array/rest_n-generate.py
   sandbox/contract/libs/contract/generate/boost/contract/detail/preprocessor/facilities/
   sandbox/contract/libs/contract/generate/boost/contract/detail/preprocessor/facilities/is_digit-generate.py
      - copied unchanged from r83214, /sandbox/contract/boost/contract/detail/preprocessor/facilities/is_digit-generate.py
   sandbox/contract/libs/contract/generate/boost/contract/detail/preprocessor/traits/
   sandbox/contract/libs/contract/generate/boost/contract/detail/preprocessor/traits/aux_/
   sandbox/contract/libs/contract/generate/boost/contract/detail/preprocessor/traits/aux_/apply-generate.py
      - copied unchanged from r83214, /sandbox/contract/boost/contract/detail/preprocessor/traits/aux_/apply-generate.py
   sandbox/contract/libs/contract/generate/boost/contract/detail/preprocessor/traits/aux_/list-generate.py
      - copied unchanged from r83214, /sandbox/contract/boost/contract/detail/preprocessor/traits/aux_/list-generate.py
   sandbox/contract/libs/contract/generate/boost/contract/detail/preprocessor/traits/aux_/select_assertion_-generate.py
      - copied unchanged from r83214, /sandbox/contract/boost/contract/detail/preprocessor/traits/aux_/select_assertion_-generate.py
   sandbox/contract/libs/contract/generate/boost/contract/detail/preprocessor/traits/func/
   sandbox/contract/libs/contract/generate/boost/contract/detail/preprocessor/traits/func/catches-generate.py
      - copied unchanged from r83214, /sandbox/contract/boost/contract/detail/preprocessor/traits/func/catches-generate.py
   sandbox/contract/libs/contract/generate/boost/contract/detail/preprocessor/traits/func/postconditions-generate.py
      - copied unchanged from r83214, /sandbox/contract/boost/contract/detail/preprocessor/traits/func/postconditions-generate.py
   sandbox/contract/libs/contract/generate/boost/contract/detail/preprocessor/tuple/
   sandbox/contract/libs/contract/generate/boost/contract/detail/preprocessor/tuple/split-generate.py
      - copied unchanged from r83214, /sandbox/contract/boost/contract/detail/preprocessor/tuple/split-generate.py
   sandbox/contract/libs/contract/generate/boost/generate.py
      - copied unchanged from r83214, /sandbox/contract/boost/generate.py
Removed:
   sandbox/contract/boost/contract/detail/preprocessor/array/first_n-generate.py
   sandbox/contract/boost/contract/detail/preprocessor/array/rest_n-generate.py
   sandbox/contract/boost/contract/detail/preprocessor/facilities/is_digit-generate.py
   sandbox/contract/boost/contract/detail/preprocessor/traits/aux_/apply-generate.py
   sandbox/contract/boost/contract/detail/preprocessor/traits/aux_/list-generate.py
   sandbox/contract/boost/contract/detail/preprocessor/traits/aux_/select_assertion_-generate.py
   sandbox/contract/boost/contract/detail/preprocessor/traits/func/catches-generate.py
   sandbox/contract/boost/contract/detail/preprocessor/traits/func/postconditions-generate.py
   sandbox/contract/boost/contract/detail/preprocessor/tuple/split-generate.py
   sandbox/contract/boost/generate.py
Text files modified:
   sandbox/contract/libs/contract/example/contracts/push_back.cpp | 8 ++++----
   1 files changed, 4 insertions(+), 4 deletions(-)

Deleted: sandbox/contract/boost/contract/detail/preprocessor/array/first_n-generate.py
==============================================================================
--- sandbox/contract/boost/contract/detail/preprocessor/array/first_n-generate.py 2013-02-28 19:11:34 EST (Thu, 28 Feb 2013)
+++ (empty file)
@@ -1,70 +0,0 @@
-
-# Copyright (C) 2008-2012 Lorenzo Caminiti
-# Distributed under the Boost Software License, Version 1.0
-# (see accompanying file LICENSE_1_0.txt or a copy at
-# http://www.boost.org/LICENSE_1_0.txt)
-# Home at http://sourceforge.net/projects/contractpp
-
-import sys
-import shutil
-
-def placeholders(start, stop):
- (s, comma) = ('', '')
- for i in range(start, stop):
- (s, comma) = (s + comma + '_' + str(i + 1), ', ')
- return s
-
-def data(max_size):
- s = ''
- for size in range(1, max_size + 1):
- for index in range(1, size + 1):
- s = s + '''
-#define CONTRACT_DETAIL_PP_ARRAY_FIRST_N_{0}_{1}({2}) \\
- ({1}, ({3})) \
-'''.format(size, index, placeholders(0, size), placeholders(0, index))
- return s
-
-BOOST_PP_LIMIT_TUPLE = raw_input("BOOST_PP_LIMIT_TUPLE" +
- " from <boost/preprocessor/limits.hpp> [64] = ")
-if BOOST_PP_LIMIT_TUPLE == "": BOOST_PP_LIMIT_TUPLE = 64
-else: BOOST_PP_LIMIT_TUPLE = int(BOOST_PP_LIMIT_TUPLE)
-
-header = sys.argv[0].replace("-generate.py", ".hpp", 1)
-shutil.copyfile(header, header + ".bak")
-h = open(header, 'w')
-
-h.write('''
-#ifndef CONTRACT_DETAIL_PP_ARRAY_FIRST_N_HPP_
-#define CONTRACT_DETAIL_PP_ARRAY_FIRST_N_HPP_
-
-// WARNING: FILE AUTOMATICALLY GENERATED, DO NOT MODIFY IT!
-// Instead modify the generation script "<FILE>-generate.py" and run
-// `$ python <FILE_NAME>-generate.py > FILE_NAME.hpp`.
-// Used: #define BOOST_PP_LIMIT_TUPLE {0}
-
-#include <boost/preprocessor/limits.hpp>
-#if BOOST_PP_LIMIT_TUPLE != {0}
-#error "Code generation used incorrect BOOST_PP_LIMIT_TUPLE"
-#endif
-
-#include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/array/size.hpp>
-#include <boost/preprocessor/array/data.hpp>
-
-// PUBLIC //
-
-#define CONTRACT_DETAIL_PP_ARRAY_FIRST_N(n, array) \\
- BOOST_PP_CAT(CONTRACT_DETAIL_PP_ARRAY_FIRST_N_, \\
- BOOST_PP_CAT(BOOST_PP_ARRAY_SIZE(array), BOOST_PP_CAT(_, n))) \\
- BOOST_PP_ARRAY_DATA(array)
-
-// DATA //
-{1}
-
-#endif // #include guard
-
-'''.format(BOOST_PP_LIMIT_TUPLE, data(BOOST_PP_LIMIT_TUPLE)))
-
-h.close()
-print "Written", header
-

Deleted: sandbox/contract/boost/contract/detail/preprocessor/array/rest_n-generate.py
==============================================================================
--- sandbox/contract/boost/contract/detail/preprocessor/array/rest_n-generate.py 2013-02-28 19:11:34 EST (Thu, 28 Feb 2013)
+++ (empty file)
@@ -1,71 +0,0 @@
-
-# Copyright (C) 2008-2012 Lorenzo Caminiti
-# Distributed under the Boost Software License, Version 1.0
-# (see accompanying file LICENSE_1_0.txt or a copy at
-# http://www.boost.org/LICENSE_1_0.txt)
-# Home at http://sourceforge.net/projects/contractpp
-
-import sys
-import shutil
-
-def placeholders(start, stop):
- (s, comma) = ('', '')
- for i in range(start, stop):
- (s, comma) = (s + comma + '_' + str(i + 1), ', ')
- return s
-
-def data(max_size):
- s = ''
- for size in range(1, max_size + 1):
- for index in range(1, size):
- s = s + '''
-#define CONTRACT_DETAIL_PP_ARRAY_REST_N_{0}_{1}({2}) \\
- ({3}, ({4})) \
-'''.format(size, index, placeholders(0, size), str(size - index),
- placeholders(index, size))
- return s
-
-BOOST_PP_LIMIT_TUPLE = raw_input("BOOST_PP_LIMIT_TUPLE" +
- " from <boost/preprocessor/limits.hpp> [64] = ")
-if BOOST_PP_LIMIT_TUPLE == "": BOOST_PP_LIMIT_TUPLE = 64
-else: BOOST_PP_LIMIT_TUPLE = int(BOOST_PP_LIMIT_TUPLE)
-
-header = sys.argv[0].replace("-generate.py", ".hpp", 1)
-shutil.copyfile(header, header + ".bak")
-h = open(header, 'w')
-
-h.write('''
-#ifndef CONTRACT_DETAIL_PP_ARRAY_REST_N_HPP_
-#define CONTRACT_DETAIL_PP_ARRAY_REST_N_HPP_
-
-// WARNING: FILE AUTOMATICALLY GENERATED, DO NOT MODIFY IT!
-// Instead modify the generation script "<FILE>-generate.py" and run
-// `$ python <FILE_NAME>-generate.py > FILE_NAME.hpp`.
-// Used: #define BOOST_PP_LIMIT_TUPLE {0}
-
-#include <boost/preprocessor/limits.hpp>
-#if BOOST_PP_LIMIT_TUPLE != {0}
-#error "Code generation used incorrect BOOST_PP_LIMIT_TUPLE"
-#endif
-
-#include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/array/size.hpp>
-#include <boost/preprocessor/array/data.hpp>
-
-// PUBLIC //
-
-#define CONTRACT_DETAIL_PP_ARRAY_REST_N(n, array) \\
- BOOST_PP_CAT(CONTRACT_DETAIL_PP_ARRAY_REST_N_, \\
- BOOST_PP_CAT(BOOST_PP_ARRAY_SIZE(array), BOOST_PP_CAT(_, n))) \\
- BOOST_PP_ARRAY_DATA(array)
-
-// DATA //
-{1}
-
-#endif // #include guard
-
-'''.format(BOOST_PP_LIMIT_TUPLE, data(BOOST_PP_LIMIT_TUPLE)))
-
-h.close()
-print "Written", header
-

Deleted: sandbox/contract/boost/contract/detail/preprocessor/facilities/is_digit-generate.py
==============================================================================
--- sandbox/contract/boost/contract/detail/preprocessor/facilities/is_digit-generate.py 2013-02-28 19:11:34 EST (Thu, 28 Feb 2013)
+++ (empty file)
@@ -1,54 +0,0 @@
-
-# Copyright (C) 2008-2012 Lorenzo Caminiti
-# Distributed under the Boost Software License, Version 1.0
-# (see accompanying file LICENSE_1_0.txt or a copy at
-# http://www.boost.org/LICENSE_1_0.txt)
-# Home at http://sourceforge.net/projects/contractpp
-
-import sys
-import shutil
-
-def data(max_size):
- s = ''
- for i in range(0, max_size + 1): # 0 and max_size included in range.
- s = s + '''
-#define CONTRACT_DETAIL_PP_IS_DIGIT_{0} (1) /* unary */ \
-'''.format(i)
- return s
-
-BOOST_PP_LIMIT_MAG = raw_input("BOOST_PP_LIMIT_MAG" +
- " from <boost/preprocessor/limits.hpp> [256] = ")
-if BOOST_PP_LIMIT_MAG == "": BOOST_PP_LIMIT_MAG = 256
-else: BOOST_PP_LIMIT_MAG = int(BOOST_PP_LIMIT_MAG)
-
-header = sys.argv[0].replace("-generate.py", ".hpp", 1)
-shutil.copyfile(header, header + ".bak")
-h = open(header, 'w')
-
-h.write('''
-#ifndef CONTRACT_DETAIL_PP_IS_DIGIT_HPP_
-#define CONTRACT_DETAIL_PP_IS_DIGIT_HPP_
-
-// WARNING: FILE AUTOMATICALLY GENERATED, DO NOT MODIFY IT!
-// Instead modify the generation script "<FILE>-generate.py" and run
-// `$ python <FILE_NAME>-generate.py > FILE_NAME.hpp`.
-// Used: #define BOOST_PP_LIMIT_MAG {0}
-
-#include <contract/detail/preprocessor/keyword/facilities/is.hpp>
-
-// PUBLIC //
-
-#define CONTRACT_DETAIL_PP_IS_DIGIT(tokens) \\
- CONTRACT_DETAIL_PP_KEYWORD_FACILITY_IS_FRONT(tokens, \\
- CONTRACT_DETAIL_PP_IS_DIGIT_)
-
-// DATA //
-{1}
-
-#endif // #include guard
-
-'''.format(BOOST_PP_LIMIT_MAG, data(BOOST_PP_LIMIT_MAG)))
-
-h.close()
-print "Written", header
-

Deleted: sandbox/contract/boost/contract/detail/preprocessor/traits/aux_/apply-generate.py
==============================================================================
--- sandbox/contract/boost/contract/detail/preprocessor/traits/aux_/apply-generate.py 2013-02-28 19:11:34 EST (Thu, 28 Feb 2013)
+++ (empty file)
@@ -1,88 +0,0 @@
-
-# Copyright (C) 2008-2012 Lorenzo Caminiti
-# Distributed under the Boost Software License, Version 1.0
-# (see accompanying file LICENSE_1_0.txt or a copy at
-# http://www.boost.org/LICENSE_1_0.txt)
-# Home at http://sourceforge.net/projects/contractpp
-
-import sys
-import shutil
-
-iterations = raw_input("maximum iterations [1] = ")
-if iterations == "": iterations = 1
-else: iterations = int(iterations)
-
-for i in range(0, iterations + 1): # 0 and iterations included in range.
- if i == 0: p = ''
- else: p = '_' + str(i)
-
- header = sys.argv[0].replace("-generate.py", p + ".hpp", 1)
- shutil.copyfile(header, header + ".bak")
- h = open(header, 'w')
-
- h.write('''
-#ifndef CONTRACT_DETAIL_PP_TRAITS_AUX_APPLY{0}_HPP_
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_APPLY{0}_HPP_
-
-// WARNING: FILE AUTOMATICALLY GENERATED, DO NOT MODIFY IT!
-// Instead modify the generation script "<FILE>-generate.py" and run
-// `$ python <FILE_NAME>-generate.py > FILE_NAME.hpp`.
-// Used maximum number of iterations: {1}
-
-#include <boost/preprocessor/config/config.hpp>
-#include <boost/preprocessor/arithmetic/inc.hpp>
-#include <boost/preprocessor/array/data.hpp>
-#include <boost/preprocessor/array/size.hpp>
-#include <boost/preprocessor/config/config.hpp>
-#include <boost/preprocessor/punctuation/comma_if.hpp>
-#include <boost/preprocessor/tuple/rem.hpp>
-#include <boost/preprocessor/tuple/elem.hpp>
-
-// PRIVATE //
-
-// From BOOST_PP_ARRAY_PUSH_BACK.
-#if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
-# define CONTRACT_DETAIL_PP_TRAITS_AUX_ARRAY_PUSH_BACK{0}_(array, elem) \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_ARRAY_PUSH_BACK_I_( \\
- BOOST_PP_ARRAY_SIZE(array), BOOST_PP_ARRAY_DATA(array), elem)
-#else
-# define CONTRACT_DETAIL_PP_TRAITS_AUX_ARRAY_PUSH_BACK{0}_(array, elem) \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_ARRAY_PUSH_BACK_D{0}_(array, elem)
-# define CONTRACT_DETAIL_PP_TRAITS_AUX_ARRAY_PUSH_BACK_D{0}_(array, elem) \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_ARRAY_PUSH_BACK_I_( \\
- BOOST_PP_ARRAY_SIZE(array), BOOST_PP_ARRAY_DATA(array), elem)
-#endif
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_ARRAY_PUSH_BACK_I{0}_(size, data, elem) \\
- (BOOST_PP_INC(size), \\
- (BOOST_PP_TUPLE_REM(size) data BOOST_PP_COMMA_IF(size) elem))
-
-// PROTECTED //
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_APPLY_INIT{0}( \\
- traits_sign, trait_macro, sign_macro) \\
- ( \\
- ( 1 /* create 1-array */, ( trait_macro( \\
- BOOST_PP_TUPLE_ELEM(2, 1, traits_sign)) ) ) \\
- , \\
- sign_macro(BOOST_PP_TUPLE_ELEM(2, 1, traits_sign)) \\
- )
-
-// Expand to next `traits_sign` applying `trait_macro(sign)` and
-// `sign_macro(macro)`.
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_APPLY{0}( \\
- traits_sign, trait_macro, sign_macro) \\
- ( \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_ARRAY_PUSH_BACK{0}_( \\
- BOOST_PP_TUPLE_ELEM(2, 0, traits_sign), \\
- trait_macro(BOOST_PP_TUPLE_ELEM(2, 1, traits_sign))) \\
- , \\
- sign_macro(BOOST_PP_TUPLE_ELEM(2, 1, traits_sign)) \\
- )
-
-#endif // #include guard
-
-'''.format(p, iterations))
-
- h.close()
- print "Written:", header
-

Deleted: sandbox/contract/boost/contract/detail/preprocessor/traits/aux_/list-generate.py
==============================================================================
--- sandbox/contract/boost/contract/detail/preprocessor/traits/aux_/list-generate.py 2013-02-28 19:11:34 EST (Thu, 28 Feb 2013)
+++ (empty file)
@@ -1,275 +0,0 @@
-
-# Copyright (C) 2008-2012 Lorenzo Caminiti
-# Distributed under the Boost Software License, Version 1.0
-# (see accompanying file LICENSE_1_0.txt or a copy at
-# http://www.boost.org/LICENSE_1_0.txt)
-# Home at http://sourceforge.net/projects/contractpp
-
-import sys
-import shutil
-
-iterations = raw_input("maximum iterations [1] = ")
-if iterations == "": iterations = 1
-else: iterations = int(iterations)
-
-for i in range(0, iterations + 1): # 0 and iterations included in range.
- if i == 0: p = ''
- else: p = '_' + str(i)
-
- header = sys.argv[0].replace("-generate.py", p + ".hpp", 1)
- shutil.copyfile(header, header + ".bak")
- h = open(header, 'w')
-
- h.write('''
-#ifndef CONTRACT_DETAIL_PP_TRAITS_AUX_LIST{0}_HPP_
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_LIST{0}_HPP_
-
-// WARNING: FILE AUTOMATICALLY GENERATED, DO NOT MODIFY IT!
-// Instead modify the generation script "<FILE>-generate.py" and run
-// `$ python <FILE_NAME>-generate.py > FILE_NAME.hpp`.
-// Used maximum number of iterations: {1}
-
-#include <contract/aux_/config.hpp>
-#include <contract/detail/preprocessor/punctuation/has_paren.hpp>
-#include <contract/detail/preprocessor/keyword/default.hpp>
-#include <contract/detail/preprocessor/keyword/void.hpp>
-#include <contract/detail/preprocessor/keyword/facilities/is.hpp>
-#include <contract/detail/preprocessor/keyword/facilities/remove.hpp>
-#include <boost/preprocessor/config/config.hpp>
-#include <boost/preprocessor/control/iif.hpp>
-#include <boost/preprocessor/tuple/elem.hpp>
-#include <boost/preprocessor/tuple/eat.hpp>
-#include <boost/preprocessor/list/append.hpp>
-#include <boost/preprocessor/seq/fold_right.hpp>
-#include <boost/preprocessor/debug/assert.hpp>
-#include <boost/config.hpp>
-
-// PRIVATE //
-
-#define CHECK_CONTRACT_DETAIL_PP_TRAITS_AUX_TAGGED_LIST_REMOVE{0} (1)
-#define ERASE_CONTRACT_DETAIL_PP_TRAITS_AUX_TAGGED_LIST_REMOVE{0} /* nothing */
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_TAGGED_LIST_REMOVE_CHECK{0}_(tokens) \\
- BOOST_PP_IIF(CONTRACT_DETAIL_PP_HAS_PAREN(tokens), \\
- 0 BOOST_PP_TUPLE_EAT(2) \\
- , \\
- CONTRACT_DETAIL_PP_KEYWORD_FACILITY_IS_FRONT \\
- )(tokens, CHECK_)
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_TAGGED_LIST_REMOVE_ERASE{0}_(tokens) \\
- CONTRACT_DETAIL_PP_KEYWORD_FACILITY_REMOVE_FRONT(tokens, \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_TAGGED_LIST_REMOVE_CHECK{0}_, ERASE_)
-
-// From PP_EXPAND (my own reentrant version).
-#if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC() && ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_DMC()
-# define CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_EXPAND{0}_(x) \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_EXPAND_I{0}_(x)
-#else
-# define CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_EXPAND{0}_(x) \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_EXPAND_OO{0}_((x))
-# define CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_EXPAND_OO{0}_(par) \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_EXPAND_I{0}_ ## par
-#endif
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_EXPAND_I{0}_(x) x
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_DFLT_OP_LASTDFLT{0}_( \\
- s, elem, list, last_default, elem_macro) \\
- ( \\
- list /* unchanged list */ \\
- , \\
- /* set last-default */ \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_COMMA(BOOST_PP_TUPLE_REM(1), \\
- CONTRACT_DETAIL_PP_KEYWORD_DEFAULT_REMOVE_FRONT(elem)) \\
- , \\
- elem_macro /* unchanged op-macro */ \\
- ) \\
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_DFLT_OP_ELEM{0}_( \\
- s, elem, list, last_default, elem_macro) \\
- ( \\
- /* append elem_macro(elem) (in front because FOLD_RIGHT) */ \\
- BOOST_PP_LIST_APPEND( \\
- ( /* list of... */ \\
- ( /* .. 2-tuple `(elem_macro(elem), default)` */ \\
- elem_macro(elem) \\
- , \\
- last_default \\
- ) \\
- , BOOST_PP_NIL ), list) \\
- , \\
- (0, ()) /* no last-default */ \\
- , \\
- elem_macro /* unchanged op-macro */ \\
- )
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_DFLT_OP{0}_( \\
- s, list_lastdefault_macro, elem) \\
- BOOST_PP_IIF(CONTRACT_DETAIL_PP_KEYWORD_IS_DEFAULT_FRONT(elem), \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_DFLT_OP_LASTDFLT{0}_ \\
- , \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_DFLT_OP_ELEM{0}_ \\
- )(s, elem, \\
- BOOST_PP_TUPLE_ELEM(3, 0, list_lastdefault_macro), \\
- BOOST_PP_TUPLE_ELEM(3, 1, list_lastdefault_macro), \\
- BOOST_PP_TUPLE_ELEM(3, 2, list_lastdefault_macro))
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_DFLT{0}_(seq, elem_macro) \\
- BOOST_PP_TUPLE_ELEM(3, 0, CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_EXPAND{0}_(\\
- BOOST_PP_SEQ_FOLD_RIGHT( \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_DFLT_OP{0}_, \\
- ( BOOST_PP_NIL, \\
- (0, ()), /* no last-default to start */ \\
- elem_macro ), seq)))
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_NODFLT_OP_ELEM{0}_( \\
- s, elem, list, elem_macro) \\
- ( \\
- BOOST_PP_LIST_APPEND( \\
- ( /* list of 1-tuple `elem_macro(elem)` */ \\
- elem_macro(elem) \\
- , BOOST_PP_NIL ), list) \\
- , \\
- elem_macro /* unchanged op-macro */ \\
- )
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_NODFLT_OP{0}_( \\
- s, list_macro, elem) \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_NODFLT_OP_ELEM{0}_(s, elem, \\
- BOOST_PP_TUPLE_ELEM(2, 0, list_macro), \\
- BOOST_PP_TUPLE_ELEM(2, 1, list_macro))
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_NODFLT{0}_( \\
- seq, elem_macro) \\
- BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_SEQ_FOLD_RIGHT( \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_NODFLT_OP{0}_,\\
- ( BOOST_PP_NIL, elem_macro ), seq))
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_NOTEMPTY{0}_( \\
- seq, allow_empty, with_defaults, elem_macro) \\
- BOOST_PP_IIF(with_defaults, \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_DFLT{0}_ \\
- , \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_NODFLT{0}_ \\
- )(seq, elem_macro)
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_EMPTY{0}_( \\
- seq, allow_empty, with_defaults, elem_macro) \\
- BOOST_PP_IIF(allow_empty, \\
- BOOST_PP_NIL /* nil list */ \\
- BOOST_PP_TUPLE_EAT(2) /* no error */ \\
- , \\
- BOOST_PP_ASSERT_MSG /* error */ \\
- )(0, ERROR_unexpected_empty_token_list)
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_IS_EMPTY_CHECK_HEAD{0}_( \\
- seq) \\
- CONTRACT_DETAIL_PP_KEYWORD_IS_VOID_FRONT(BOOST_PP_SEQ_HEAD(seq))
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_IS_EMPTY_CHECK{0}_(seq) \\
- BOOST_PP_IIF(BOOST_PP_EQUAL(BOOST_PP_SEQ_SIZE(seq), 1), \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_IS_EMPTY_CHECK_HEAD{0}_ \\
- , \\
- 0 BOOST_PP_TUPLE_EAT(1) \\
- )(seq)
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_IS_EMPTY{0}_(void_or_seq) \\
- BOOST_PP_IIF(CONTRACT_DETAIL_PP_KEYWORD_IS_VOID_FRONT(void_or_seq), \\
- 1 BOOST_PP_TUPLE_EAT(1) \\
- , \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_IS_EMPTY_CHECK{0}_ \\
- )(void_or_seq)
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ{0}_( \\
- void_or_seq, allow_empty, with_defaults, elem_macro) \\
- BOOST_PP_IIF(BOOST_PP_EXPAND( /* expand for MSVC */ \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_IS_EMPTY{0}_( \\
- void_or_seq)), \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_EMPTY{0}_ \\
- , \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ_NOTEMPTY{0}_ \\
- )(void_or_seq, allow_empty, with_defaults, elem_macro)
-
-#ifndef BOOST_NO_VARIADIC_MACROS
-# include <contract/detail/preprocessor/variadic/to_seq.hpp>
-# define CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_SPLIT_SEQ{0}_(...) \\
- CONTRACT_DETAIL_PP_VARIADIC_TO_SEQ(void, __VA_ARGS__) \\
- , /* split into 2-tuple `(seq_from(__VA_ARGS__), following_tokens)` */
-#else // variadics
-# define CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_SPLIT_SEQ{0}_(seq) \\
- seq \\
- , /* split into 2-tuple `(seq_from(__VA_ARGS__), following_tokens)` */
-#endif // variadics
-
-// Expand from paren_tokens `(a, b, ...) tokens...` (variadics) or
-// `( (a) (b) ... ) tokens...` to `(a) (b) ...`.
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_GET_SEQ{0}_(paren_tokens) \\
- BOOST_PP_TUPLE_ELEM(2, 0, \\
- ( /* split expand to 2-tuple `(seq, ignore_tokens)` */ \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_SPLIT_SEQ{0}_ paren_tokens \\
- ) \\
- )
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_TAGGED_LIST{0}_( \\
- tokens, allow_empty, with_defaults, remove_tag_macro, elem_macro) \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ{0}_( \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_GET_SEQ{0}_( \\
- remove_tag_macro(tokens)), \\
- allow_empty, with_defaults, elem_macro)
-
-// PROTECTED //
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_TAGGED_LIST{0}(tokens, \\
- allow_empty, with_defaults, \\
- is_tagged_macro, remove_tag_macro, elem_macro) \\
- BOOST_PP_IIF(is_tagged_macro(tokens), \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_TAGGED_LIST{0}_ \\
- , \\
- BOOST_PP_NIL /* nil list */ \\
- BOOST_PP_TUPLE_EAT(5) \\
- )(tokens, allow_empty, with_defaults, remove_tag_macro, elem_macro)
-
-#ifndef BOOST_NO_VARIADIC_MACROS
-# define CONTRACT_DETAIL_PP_TRAITS_AUX_TAGGED_LIST_REMOVE{0}(...) /*nothing*/
-#else // variadics
-# define CONTRACT_DETAIL_PP_TRAITS_AUX_TAGGED_LIST_REMOVE{0}(seq) /*nothing*/
-#endif // variadics
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_AFTER_TAGGED_LIST{0}( \\
- tokens, is_tagged_macro, removing_prefix) \\
- CONTRACT_DETAIL_PP_KEYWORD_FACILITY_REMOVE_FRONT(tokens, \\
- is_tagged_macro, removing_prefix)
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_LIST{0}(tokens, \\
- allow_empty, with_defaults, elem_macro) \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_FROM_SEQ{0}_( \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_GET_SEQ{0}_(tokens), \\
- allow_empty, with_defaults, elem_macro)
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_AFTER_LIST{0}(tokens) \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_TAGGED_LIST_REMOVE_ERASE{0}_( \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_LIST_EXPAND{0}_( \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_TAGGED_LIST_REMOVE{0} tokens \\
- ))
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_OPTIONAL_LIST{0}( \\
- tokens, allow_empty, with_defaults, elem_macro) \\
- BOOST_PP_IIF(CONTRACT_DETAIL_PP_HAS_PAREN(tokens), \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_LIST{0} /* list present */ \\
- , \\
- BOOST_PP_NIL BOOST_PP_TUPLE_EAT(4) /* expand to nil pp-list */ \\
- )(tokens, allow_empty, with_defaults, elem_macro)
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_AFTER_OPTIONAL_LIST{0}(tokens) \\
- BOOST_PP_IIF(CONTRACT_DETAIL_PP_HAS_PAREN(tokens), \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_AFTER_LIST{0} /* list present */ \\
- , \\
- tokens BOOST_PP_TUPLE_EAT(1) /* expand to tokens */ \\
- )(tokens)
-
-#endif // #include guard
-
-'''.format(p, iterations))
-
- h.close()
- print "Written:", header
-

Deleted: sandbox/contract/boost/contract/detail/preprocessor/traits/aux_/select_assertion_-generate.py
==============================================================================
--- sandbox/contract/boost/contract/detail/preprocessor/traits/aux_/select_assertion_-generate.py 2013-02-28 19:11:34 EST (Thu, 28 Feb 2013)
+++ (empty file)
@@ -1,118 +0,0 @@
-
-# Copyright (C) 2008-2012 Lorenzo Caminiti
-# Distributed under the Boost Software License, Version 1.0
-# (see accompanying file LICENSE_1_0.txt or a copy at
-# http://www.boost.org/LICENSE_1_0.txt)
-# Home at http://sourceforge.net/projects/contractpp
-
-import sys
-import shutil
-
-CONTRACT_LIMIT_NESTED_SELECT_ASSERTIONS = raw_input(
- "CONTRACT_LIMIT_NESTED_SELECT_ASSERTIONS form " +
- "<contract/limits.hpp> [5] = ")
-if CONTRACT_LIMIT_NESTED_SELECT_ASSERTIONS == "":
- CONTRACT_LIMIT_NESTED_SELECT_ASSERTIONS = 5
-else:
- CONTRACT_LIMIT_NESTED_SELECT_ASSERTIONS = int(
- CONTRACT_LIMIT_NESTED_SELECT_ASSERTIONS)
-
-# 1 and CONTRACT_LIMIT_NESTED_SELECT_ASSERTIONS included in range.
-for i in range(1, CONTRACT_LIMIT_NESTED_SELECT_ASSERTIONS + 1):
- header = sys.argv[0].replace("-generate.py", str(i) + ".hpp", 1)
- shutil.copyfile(header, header + ".bak")
- h = open(header, 'w')
-
- h.write('''
-#ifndef CONTRACT_DETAIL_PP_TRAITS_AUX_SELECT_ASSERTION_{0}_HPP_
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_SELECT_ASSERTION_{0}_HPP_
-
-// WARNING: FILE AUTOMATICALLY GENERATED, DO NOT MODIFY IT!
-// Instead modify the generation script "<FILE>-generate.py" and run
-// `$ python <FILE_NAME>-generate.py > FILE_NAME.hpp`.
-// Used CONTRACT_LIMIT_NESTED_SELECT_ASSERTIONS: {2}
-
-#include <contract/limits.hpp>
-#if CONTRACT_LIMIT_NESTED_SELECT_ASSERTIONS != {2}
-#error "Code generation used incorrect CONTRACT_LIMIT_NESTED_SELECT_ASSERTIONS"
-#endif
-
-#include <contract/detail/preprocessor/traits/aux_/assertion.hpp>
-#include <contract/detail/preprocessor/traits/aux_/select_assertion.hpp>
-#if {1} <= {2}
-# include <contract/detail/preprocessor/traits/aux_/select_assertion_{1}.hpp>
-#endif
-#include <contract/detail/preprocessor/keyword/contract/requires.hpp>
-#include <contract/detail/preprocessor/keyword/if.hpp>
-
-// PRIVATE //
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_SELECT_ASSERTION_ELEM_{0}_( \\
- d, number_instruction_requirements_traits, assertion) \\
- BOOST_PP_IIF(CONTRACT_DETAIL_PP_KEYWORD_IS_IF_FRONT(assertion), \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_SELECT_ASSERTION_{1} \\
- , BOOST_PP_IIF(CONTRACT_DETAIL_PP_TRAITS_AUX_ASSERTION_IS_STATEMENT( \\
- assertion), \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_ASSERTION_STATEMENT \\
- , BOOST_PP_IIF(CONTRACT_DETAIL_PP_KEYWORD_IS_REQUIRES_FRONT(assertion), \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_ASSERTION_REQUIRES \\
- , /* else: bool, const, or static assert */ \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_ASSERTION_CONDITION \\
- )))(d, assertion \\
- , BOOST_PP_TUPLE_ELEM(4, 0, number_instruction_requirements_traits) \\
- , BOOST_PP_TUPLE_ELEM(4, 1, number_instruction_requirements_traits) \\
- , BOOST_PP_TUPLE_ELEM(4, 2, number_instruction_requirements_traits) \\
- , BOOST_PP_TUPLE_ELEM(4, 3, number_instruction_requirements_traits) \\
- )
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_SELECT_ASSERTION_LIST_{0}_( \\
- d, select_assertions, number_instruction_requirements_traits) \\
- BOOST_PP_LIST_FOLD_LEFT_ ## d( \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_SELECT_ASSERTION_ELEM_{0}_, \\
- number_instruction_requirements_traits, select_assertions)
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_SELECT_ASSERTION_{0}_(d, select_traits, \\
- prev_number, prev_instruction, prev_requirements, traits) \\
- /* 6th, append right-curly to end else block */ \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_SELECT_ASSERTION_PREPEND_RCURLY(d \\
- /* 5th, append else-assertions */ \\
- , CONTRACT_DETAIL_PP_TRAITS_AUX_SELECT_ASSERTION_LIST_{0}_(d \\
- , CONTRACT_DETAIL_PP_TRAITS_AUX_SELECT_ASSERTION_ELSES( \\
- select_traits) \\
- /* 4th, append else-statement `else` */ \\
- , CONTRACT_DETAIL_PP_TRAITS_AUX_SELECT_ASSERTION_PREPEND_ELSE(d \\
- /* 3rd, append right-curly to end if block */ \\
- ,CONTRACT_DETAIL_PP_TRAITS_AUX_SELECT_ASSERTION_PREPEND_RCURLY(\\
- d \\
- /* 2nd, append then-assertions */ \\
- ,CONTRACT_DETAIL_PP_TRAITS_AUX_SELECT_ASSERTION_LIST_{0}_(\\
- d \\
- ,CONTRACT_DETAIL_PP_TRAITS_AUX_SELECT_ASSERTION_THENS(\\
- select_traits) \\
- /* 1st, append if-statement `if(...)` */ \\
- , CONTRACT_DETAIL_PP_TRAITS_AUX_SELECT_ASSERTION_PREPEND_IF(d \\
- , CONTRACT_DETAIL_PP_TRAITS_AUX_SELECT_ASSERTION_IF(select_traits) \\
- , (prev_number, prev_instruction, prev_requirements, traits) \\
- ) \\
- ) \\
- ) \\
- ) \\
- ) \\
- )
-
-// PROTECTED //
-
-#define CONTRACT_DETAIL_PP_TRAITS_AUX_SELECT_ASSERTION_{0}(d, assertion, \\
- prev_number, prev_instruction, prev_requirements, traits)\\
- CONTRACT_DETAIL_PP_TRAITS_AUX_ASSERTION_APPEND_TUPLE(d, \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_SELECT_ASSERTION_{0}_(d, \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_SELECT_ASSERTION(assertion),\\
- prev_number, prev_instruction, prev_requirements, traits))
-
-#endif // #include guard
-
-'''.format(str(i), str(i + 1), str(CONTRACT_LIMIT_NESTED_SELECT_ASSERTIONS)))
-
- h.close()
- print "Written:", header
-

Deleted: sandbox/contract/boost/contract/detail/preprocessor/traits/func/catches-generate.py
==============================================================================
--- sandbox/contract/boost/contract/detail/preprocessor/traits/func/catches-generate.py 2013-02-28 19:11:34 EST (Thu, 28 Feb 2013)
+++ (empty file)
@@ -1,139 +0,0 @@
-
-# Copyright (C) 2008-2012 Lorenzo Caminiti
-# Distributed under the Boost Software License, Version 1.0
-# (see accompanying file LICENSE_1_0.txt or a copy at
-# http://www.boost.org/LICENSE_1_0.txt)
-# Home at http://sourceforge.net/projects/contractpp
-
-import sys
-import shutil
-
-def data(max):
- s = ''
- for i in range(0, max):
- i = max - i - 1 # Reverse iteration order.
- if i == 0: p = ""
- else: p = "_" + str(i)
- if i == max - 1:
- next_sign_macro = "ERROR_support_maximum_of_" + str(max) + \
- "_catch_statements"
- else:
- next_sign_macro = \
- "CONTRACT_DETAIL_PP_FUNC_TRAITS_CATCHES_TRAIT_SIGN_" + \
- str(i + 1) + "_"
- s = s + '''
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_CATCHES_TRAIT_SIGN_NEXT{0}_(seq_sign) \\
- BOOST_PP_IIF(CONTRACT_DETAIL_PP_KEYWORD_IS_CATCH_FRONT( \\
- BOOST_PP_TUPLE_ELEM(2, 1, seq_sign)), \\
- {1} \\
- , \\
- seq_sign BOOST_PP_TUPLE_EAT(2) \\
- )(BOOST_PP_TUPLE_ELEM(2, 0, seq_sign), BOOST_PP_TUPLE_ELEM(2, 1, seq_sign))
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_CATCHES_TRAIT_SIGN{0}_(seq, sign) \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_CATCHES_TRAIT_SIGN_NEXT{0}_( ( \\
- seq BOOST_PP_CAT( \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_CATCHES_EXCEPTION_DECL_, sign) \\
- ) ) \
-'''.format(p, next_sign_macro)
- return s
-
-CONTRACT_LIMIT_CONSTRUCTOR_TRY_BLOCK_CATCHES = raw_input(
- "CONTRACT_LIMIT_CONSTRUCTOR_TRY_BLOCK_CATCHES" +
- " from <contract/limits.hpp> [10] = ")
-if CONTRACT_LIMIT_CONSTRUCTOR_TRY_BLOCK_CATCHES == "":
- CONTRACT_LIMIT_CONSTRUCTOR_TRY_BLOCK_CATCHES = 10
-else:
- CONTRACT_LIMIT_CONSTRUCTOR_TRY_BLOCK_CATCHES = int(
- CONTRACT_LIMIT_CONSTRUCTOR_TRY_BLOCK_CATCHES)
-
-header = sys.argv[0].replace("-generate.py", ".hpp", 1)
-shutil.copyfile(header, header + ".bak")
-h = open(header, 'w')
-
-h.write('''
-#ifndef CONTRACT_DETAIL_PP_FUNC_TRAITS_CATCHES_HPP_
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_CATCHES_HPP_
-
-// WARNING: FILE AUTOMATICALLY GENERATED, DO NOT MODIFY IT!
-// Instead modify the generation script "<FILE>-generate.py" and run
-// `$ python <FILE_NAME>-generate.py > FILE_NAME.hpp`.
-// Used: #define CONTRACT_LIMIT_CONSTRUCTOR_TRY_BLOCK_CATCHES {0}
-
-#include <contract/limits.hpp>
-#if CONTRACT_LIMIT_CONSTRUCTOR_TRY_BLOCK_CATCHES != {0}
-#error "Code generation used incorrect CONTRACT_LIMIT_CONSTRUCTOR_TRY_BLOCK_CATCHES"
-#endif
-
-#include <contract/detail/preprocessor/traits/aux_/apply.hpp>
-#include <contract/detail/preprocessor/keyword/catch.hpp>
-#include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/control/iif.hpp>
-#include <boost/preprocessor/array/elem.hpp>
-#include <boost/preprocessor/tuple/elem.hpp>
-#include <boost/preprocessor/tuple/eat.hpp>
-
-// PRIVATE //
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_CATCHES_STATEMENTS_(statements) \\
- /* beginning of seq elem of 3-tuple from DECL_catch here */ \\
- statements)), /* this comma splits */
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_CATCHES_EXCEPTION_DECL_catch( \\
- exception_decl) \\
- ((exception_decl, CONTRACT_DETAIL_PP_FUNC_TRAITS_CATCHES_STATEMENTS_ \\
- /* end of seq elem of 3-tuple from STATEMENTS_ here */
-{1}
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_CATCHES_LIST_(sign) \\
- CONTRACT_DETAIL_PP_SEQ_TO_LIST_NEVER_EMPTY(BOOST_PP_TUPLE_ELEM(2, 0, \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_CATCHES_TRAIT_SIGN_( \\
- BOOST_PP_EMPTY(), sign)))
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_CATCHES_TRAIT_(sign) \\
- BOOST_PP_IIF(CONTRACT_DETAIL_PP_KEYWORD_IS_CATCH_FRONT(sign), \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_CATCHES_LIST_ \\
- , \\
- BOOST_PP_NIL BOOST_PP_TUPLE_EAT(1) /* empty catch list */ \\
- )(sign)
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_CATCHES_REMOVE_(sign) \\
- BOOST_PP_TUPLE_ELEM(2, 1, \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_CATCHES_TRAIT_SIGN_( \\
- BOOST_PP_EMPTY(), sign))
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_CATCHES_SIGN_(sign) \\
- BOOST_PP_IIF(CONTRACT_DETAIL_PP_KEYWORD_IS_CATCH_FRONT(sign), \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_CATCHES_REMOVE_ \\
- , \\
- sign BOOST_PP_TUPLE_EAT(1) \\
- )(sign)
-
-// PROTECTED //
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_AUX_CATCHES(traits_sign) \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_APPLY(traits_sign, \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_CATCHES_TRAIT_, \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_CATCHES_SIGN_)
-
-// PUBLIC //
-
-// Expand to pp-list of catch traits `(exception_decl, statements)`.
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_CATCHES(func_traits) \\
- BOOST_PP_ARRAY_ELEM(23, func_traits)
-
-// Expand to either `exception_type exception_var` or `...`.
-#define CONTRACT_DETAIL_PP_CATCH_TRAITS_EXCEPTION_DECL(catch_traits) \\
- BOOST_PP_TUPLE_ELEM(2, 0, catch_traits)
-
-// Expand to `instruction; instruction; ...` (all instructions optional).
-#define CONTRACT_DETAIL_PP_CATCH_TRAITS_STATEMENTS(catch_traits) \\
- BOOST_PP_TUPLE_ELEM(2, 1, catch_traits)
-
-#endif // #include guard
-
-'''.format(CONTRACT_LIMIT_CONSTRUCTOR_TRY_BLOCK_CATCHES,
- data(CONTRACT_LIMIT_CONSTRUCTOR_TRY_BLOCK_CATCHES)))
-
-h.close()
-print "Written:", header
-

Deleted: sandbox/contract/boost/contract/detail/preprocessor/traits/func/postconditions-generate.py
==============================================================================
--- sandbox/contract/boost/contract/detail/preprocessor/traits/func/postconditions-generate.py 2013-02-28 19:11:34 EST (Thu, 28 Feb 2013)
+++ (empty file)
@@ -1,402 +0,0 @@
-
-# Copyright (C) 2008-2012 Lorenzo Caminiti
-# Distributed under the Boost Software License, Version 1.0
-# (see accompanying file LICENSE_1_0.txt or a copy at
-# http://www.boost.org/LICENSE_1_0.txt)
-# Home at http://sourceforge.net/projects/contractpp
-
-import sys
-import shutil
-
-def data(max):
- s = ''
- for i in reversed(range(1, max)): # i == 0 handled separately (no `seq`).
- p = "_" + str(i)
- if i == max - 1:
- next_sign_macro = "ERROR_support_maximum_of_" + str(max) + \
- "_old_value_declarations"
- else:
- next_sign_macro = \
- "CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_TRAIT_SIGN_" + \
- str(i + 1) + "_"
- s = s + '''
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_TRAIT_SIGN_NEXT{0}_( \\
- seq_sign) \\
- BOOST_PP_IIF(CONTRACT_DETAIL_PP_KEYWORD_IS_POSTCONDITION_FRONT( \\
- BOOST_PP_TUPLE_ELEM(2, 1, seq_sign)), \\
- {1} \\
- , BOOST_PP_IIF(CONTRACT_DETAIL_PP_HAS_PAREN( \\
- BOOST_PP_TUPLE_ELEM(2, 1, seq_sign)), \\
- {1} \\
- , \\
- seq_sign BOOST_PP_TUPLE_EAT(2) \\
- ))(BOOST_PP_TUPLE_ELEM(2, 0, seq_sign), BOOST_PP_TUPLE_ELEM(2, 1, seq_sign))
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_TRAIT_SIGN{0}_( \\
- seq, sign) \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_TRAIT_SIGN_NEXT{0}_( ( \\
- seq \\
- BOOST_PP_IIF(CONTRACT_DETAIL_PP_HAS_PAREN(sign), \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_postcondition \\
- , \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_CAT_ \\
- )(sign) \\
- ) ) \
-'''.format(p, next_sign_macro)
- return s
-
-CONTRACT_LIMIT_OLDOFS = raw_input("CONTRACT_LIMIT_OLDOFS" +
- "from <contract/limits.hpp> [15] = ")
-if CONTRACT_LIMIT_OLDOFS == "": CONTRACT_LIMIT_OLDOFS = 15
-else: CONTRACT_LIMIT_OLDOFS = int(CONTRACT_LIMIT_OLDOFS)
-
-header = sys.argv[0].replace("-generate.py", ".hpp", 1)
-shutil.copyfile(header, header + ".bak")
-h = open(header, 'w')
-
-h.write('''
-#ifndef CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_HPP_
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_HPP_
-
-// WARNING: FILE AUTOMATICALLY GENERATED, DO NOT MODIFY IT!
-// Instead modify the generation script "<FILE>-generate.py" and run
-// `$ python <FILE_NAME>-generate.py > FILE_NAME.hpp`.
-// Used: #define CONTRACT_LIMIT_OLDOFS {0}
-
-#include <contract/limits.hpp>
-#if CONTRACT_LIMIT_OLDOFS != {0}
-#error "Code generation used incorrect CONTRACT_LIMIT_OLDOFS"
-#endif
-
-// Old-of already parsed but header included here for user to access this trait.
-#include <contract/detail/preprocessor/traits/oldof.hpp>
-
-#include <contract/detail/preprocessor/traits/aux_/oldof.hpp>
-#include <contract/detail/preprocessor/traits/aux_/type.hpp>
-#include <contract/detail/preprocessor/traits/aux_/nil.hpp>
-#include <contract/detail/preprocessor/traits/assertion.hpp>
-#include <contract/detail/preprocessor/keyword/contract/postcondition.hpp>
-#include <contract/detail/preprocessor/keyword/auto.hpp>
-#include <contract/detail/preprocessor/variadic/to_seq.hpp>
-#include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/config/config.hpp>
-#include <boost/preprocessor/control/iif.hpp>
-#include <boost/preprocessor/control/expr_iif.hpp>
-#include <boost/preprocessor/logical/compl.hpp>
-#include <boost/preprocessor/debug/assert.hpp>
-#include <boost/preprocessor/tuple/elem.hpp>
-#include <boost/preprocessor/tuple/eat.hpp>
-#include <boost/preprocessor/array/elem.hpp>
-#include <boost/preprocessor/seq/fold_right.hpp>
-#include <boost/preprocessor/list/append.hpp>
-#include <boost/config.hpp>
-
-// PRIVATE //
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_OLDOF_TYPE_( \\
- oldof_typed_assignment) \\
- BOOST_PP_IIF(CONTRACT_DETAIL_PP_KEYWORD_IS_AUTO_FRONT( \\
- oldof_typed_assignment), \\
- /* 0-size array for no type (`auto` for typeof deduction) */ \\
- (0, ()) BOOST_PP_TUPLE_EAT(1) \\
- , \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_TYPE \\
- )(oldof_typed_assignment)
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_OLDOF_ASSIGNMENT_( \\
- oldof_typed_assignment) \\
- CONTRACT_DETAIL_PP_KEYWORD_AUTO_REMOVE_FRONT( \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_AFTER_TYPE( \\
- oldof_typed_assignment \\
- ))
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_OLDOF_TYPED_ASSIGNMENT_(\\
- s, result_oldofs_assertions_lastoldofexpr, oldof_typed_assignment) \\
- ( \\
- BOOST_PP_TUPLE_ELEM(4, 0, result_oldofs_assertions_lastoldofexpr) \\
- , \\
- BOOST_PP_LIST_APPEND( \\
- ( /* pp-list */ \\
- (3, ( /* oldof pp-array with `NIL type, var =, expr` */ \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_OLDOF_TYPE_(\\
- oldof_typed_assignment) \\
- , \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_OLDOF_ASSIGNMENT_( \\
- oldof_typed_assignment) \\
- , \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_OLDOF_REMOVE_FRONT( \\
- BOOST_PP_TUPLE_ELEM(4, 3, \\
- result_oldofs_assertions_lastoldofexpr)) \\
- ) ) \\
- , \\
- BOOST_PPNIL \\
- ) \\
- , BOOST_PP_TUPLE_ELEM(4, 1, \\
- result_oldofs_assertions_lastoldofexpr)) \\
- , \\
- BOOST_PP_TUPLE_ELEM(4, 2, result_oldofs_assertions_lastoldofexpr) \\
- , \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_NIL /* no open old-of expr */ \\
- )
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_OLDOF_EXPR_( \\
- s, result_oldofs_assertions_lastoldofexpr, oldof_expr) \\
- ( \\
- BOOST_PP_TUPLE_ELEM(4, 0, result_oldofs_assertions_lastoldofexpr) \\
- , \\
- BOOST_PP_TUPLE_ELEM(4, 1, result_oldofs_assertions_lastoldofexpr) \\
- , \\
- BOOST_PP_TUPLE_ELEM(4, 2, result_oldofs_assertions_lastoldofexpr) \\
- , \\
- oldof_expr /* open an old-of expr (expect old-of assignment next) */ \\
- )
-
-#define return_CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_STRIP_RETURN \\
- /* nothing */
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_RESULT_ASSIGNMENT_( \\
- s, result_oldofs_assertions_lastoldofexpr, result_assignment) \\
- ( \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_NIL /* optional trait */ \\
- /* LIMITATION: With this implementation, multiple result */ \\
- /* declarations override each other (instead of compiler error) */ \\
- CONTRACT_DETAIL_PP_KEYWORD_AUTO_REMOVE_FRONT(BOOST_PP_CAT( \\
- result_assignment, \\
- _CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_STRIP_RETURN)) \\
- , \\
- BOOST_PP_TUPLE_ELEM(4, 1, result_oldofs_assertions_lastoldofexpr) \\
- , \\
- BOOST_PP_TUPLE_ELEM(4, 2, result_oldofs_assertions_lastoldofexpr) \\
- , \\
- BOOST_PP_TUPLE_ELEM(4, 3, result_oldofs_assertions_lastoldofexpr) \\
- )
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_ASSERTION_( \\
- s, result_oldofs_assertions_lastoldofexpr, assertion) \\
- ( \\
- BOOST_PP_TUPLE_ELEM(4, 0, result_oldofs_assertions_lastoldofexpr) \\
- , \\
- BOOST_PP_TUPLE_ELEM(4, 1, result_oldofs_assertions_lastoldofexpr) \\
- , \\
- BOOST_PP_LIST_APPEND( ( assertion, BOOST_PP_NIL ), \\
- BOOST_PP_TUPLE_ELEM(4, 2, \\
- result_oldofs_assertions_lastoldofexpr)) \\
- , \\
- BOOST_PP_TUPLE_ELEM(4, 3, result_oldofs_assertions_lastoldofexpr) \\
- )
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_FROM_SEQ_OP_( \\
- s, result_oldofs_assertions_lastoldofexpr, elem) \\
- BOOST_PP_IIF(BOOST_PP_COMPL(CONTRACT_DETAIL_PP_TRAITS_AUX_IS_NIL( \\
- BOOST_PP_TUPLE_ELEM(4, 3, \\
- result_oldofs_assertions_lastoldofexpr))), \\
- /* prev there was an old-of expr so elem must be old-of assignment */\\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_OLDOF_TYPED_ASSIGNMENT_ \\
- , BOOST_PP_IIF(CONTRACT_DETAIL_PP_TRAITS_AUX_IS_OLDOF_FRONT(elem), \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_OLDOF_EXPR_ \\
- , BOOST_PP_IIF(CONTRACT_DETAIL_PP_KEYWORD_IS_AUTO_FRONT(elem), \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_RESULT_ASSIGNMENT_ \\
- , /* else, it is an assertion */ \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_ASSERTION_ \\
- )))(s, result_oldofs_assertions_lastoldofexpr, elem)
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_FROM_SEQ_3TUPLE_( \\
- result_oldofs_assertions_lastoldofexpr) \\
- ( /* after folding, ignore 4th elem `lastoldofexpr` */ \\
- BOOST_PP_TUPLE_ELEM(4, 0, result_oldofs_assertions_lastoldofexpr) \\
- , \\
- BOOST_PP_TUPLE_ELEM(4, 1, result_oldofs_assertions_lastoldofexpr) \\
- , \\
- BOOST_PP_TUPLE_ELEM(4, 2, result_oldofs_assertions_lastoldofexpr) \\
- )
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_FROM_SEQ_(seq_sign) \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_FROM_SEQ_3TUPLE_( \\
- BOOST_PP_SEQ_FOLD_RIGHT( \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_FROM_SEQ_OP_, \\
- ( \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_NIL /* no result */ \\
- , \\
- BOOST_PP_NIL /* no oldofs */ \\
- , \\
- BOOST_PP_NIL /* no assertions */ \\
- , \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_NIL /* no last oldof expr */ \\
- ), \\
- BOOST_PP_TUPLE_ELEM(2, 0, seq_sign) \\
- ) \\
- )
-
-// Adapted from PP_CAT (needed for reentrancy as CAT already used by VARIADIC).
-#if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
-# define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_CAT_(a, b) \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_CAT_I_(a, b)
-#else
-# define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_CAT_(a, b) \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_CAT_OO_((a, b))
-# define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_CAT_OO_(par) \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_CAT_I_ ## par
-#endif
-#if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
-# define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_CAT_I_(a, b) a ## b
-#else
-# define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_CAT_I_(a, b) \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_CAT_II_(a ## b)
-# define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_CAT_II_(res) res
-#endif
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_PAREN_(paren) \\
- CONTRACT_DETAIL_PP_TUPLE_SPLIT(1) paren
-#ifndef BOOST_NO_VARIADIC_MACROS
-# include <contract/detail/preprocessor/variadic/to_seq.hpp>
-# define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_VARIADIC_( \\
- ...) \\
- CONTRACT_DETAIL_PP_VARIADIC_TO_SEQ(void, __VA_ARGS__) , /*comma split*/
-# define \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_MAYBE_PAREN1_( \
- paren) \\
- BOOST_PP_IIF(CONTRACT_DETAIL_PP_KEYWORD_IS_POSTCONDITION_FRONT( \\
- CONTRACT_DETAIL_PP_VARIADIC_EAT paren), \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_PAREN_ \\
- /* unfortunately this needs to know that initialize is next (needed */\\
- /* to handle typed old-of when no variadic macros) */ \\
- , BOOST_PP_IIF(CONTRACT_DETAIL_PP_KEYWORD_IS_INITIALIZE_FRONT( \\
- CONTRACT_DETAIL_PP_VARIADIC_EAT paren), \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_PAREN_ \\
- , BOOST_PP_IIF(CONTRACT_DETAIL_PP_TRAITS_AUX_IS_NIL_FRONT( \\
- CONTRACT_DETAIL_PP_VARIADIC_EAT paren), \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_PAREN_ \\
- , BOOST_PP_IIF(CONTRACT_DETAIL_PP_HAS_PAREN( \\
- CONTRACT_DETAIL_PP_VARIADIC_EAT paren), \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_PAREN_ \\
- , \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_VARIADIC_ \\
- ))))(paren)
-# define \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_MAYBE_PAREN_( \\
- tokens) \\
- BOOST_PP_IIF(CONTRACT_DETAIL_PP_HAS_PAREN(tokens), \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_MAYBE_PAREN1_ \\
- , \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_VARIADIC_ \\
- )(tokens)
-# define \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_postcondition(...)\\
- BOOST_PP_IIF(BOOST_PP_EQUAL(1, CONTRACT_DETAIL_PP_VARIADIC_SIZE( \\
- __VA_ARGS__)), \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_MAYBE_PAREN_ \\
- , \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_VARIADIC_ \\
- )(__VA_ARGS__)
-#else
-# define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_TOKEN_( \\
- token) \\
- (token) , /* comma split */
-# define \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_postcondition( \\
- tokens) \\
- BOOST_PP_IIF(CONTRACT_DETAIL_PP_HAS_PAREN(tokens), \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_PAREN_ \\
- , \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_TOKEN_ \\
- )(tokens)
-#endif
-
-// Precondition: sign is `postcondition(...)`.
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_CAT_(sign) \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_CAT_( \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_, sign)
-{1}
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_TRAIT_SIGN_NEXT_( \\
- seq_sign) \\
- BOOST_PP_IIF(CONTRACT_DETAIL_PP_KEYWORD_IS_POSTCONDITION_FRONT( \\
- BOOST_PP_TUPLE_ELEM(2, 1, seq_sign)), \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_TRAIT_SIGN_1_ \\
- , BOOST_PP_IIF(CONTRACT_DETAIL_PP_HAS_PAREN( \\
- BOOST_PP_TUPLE_ELEM(2, 1, seq_sign)), \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_TRAIT_SIGN_1_ \\
- , \\
- seq_sign BOOST_PP_TUPLE_EAT(2) \\
- ))(BOOST_PP_TUPLE_ELEM(2, 0, seq_sign), BOOST_PP_TUPLE_ELEM(2, 1, seq_sign))
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_TRAIT_SIGN_(sign) \\
- BOOST_PP_EXPAND( \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_TRAIT_SIGN_NEXT_( ( \\
- BOOST_PP_IIF(CONTRACT_DETAIL_PP_HAS_PAREN(sign), \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_postcondition \\
- , \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SPLIT_SEQ_CAT_ \\
- )(sign) \\
- ) ) )
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_ASSERTION_LIST_( \\
- result_oldofs_assertions) \\
- ( \\
- BOOST_PP_TUPLE_ELEM(3, 0, result_oldofs_assertions) \\
- , \\
- BOOST_PP_TUPLE_ELEM(3, 1, result_oldofs_assertions) \\
- , \\
- CONTRACT_DETAIL_PP_ASSERTION_TRAITS(BOOST_PP_TUPLE_ELEM(3, 2, \\
- result_oldofs_assertions)) /* process assertion traits */ \\
- )
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_LIST_(sign) \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_ASSERTION_LIST_( \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_FROM_SEQ_( \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_TRAIT_SIGN_( \\
- sign \\
- )))
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_TRAIT_(sign) \\
- BOOST_PP_IIF(CONTRACT_DETAIL_PP_KEYWORD_IS_POSTCONDITION_FRONT(sign), \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_LIST_ \\
- , \\
- ( \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_NIL /* no result */ \\
- , \\
- BOOST_PP_NIL /* no oldofs */ \\
- , \\
- BOOST_PP_NIL /* no assertions */ \\
- ) \\
- BOOST_PP_TUPLE_EAT(1) \\
- )(sign)
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_REMOVE_(sign) \\
- BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_EXPAND( \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_TRAIT_SIGN_(sign)))
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SIGN_(sign) \\
- BOOST_PP_IIF(CONTRACT_DETAIL_PP_KEYWORD_IS_POSTCONDITION_FRONT(sign), \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_REMOVE_ \\
- , \\
- sign BOOST_PP_TUPLE_EAT(1) \\
- )(sign)
-
-// PROTECTED //
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_AUX_POSTCONDITIONS(traits_sign) \\
- CONTRACT_DETAIL_PP_TRAITS_AUX_APPLY(traits_sign, \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_TRAIT_, \\
- CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS_SIGN_)
-
-// PUBLIC //
-
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITION_RESULT_ASSIGNMENT( \\
- func_traits) \\
- BOOST_PP_CAT(CONTRACT_DETAIL_PP_TRAITS_AUX_NIL_REMOVE_, \\
- BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_ARRAY_ELEM(21, func_traits)))
-
-// Expand to pp-list of oldofs (see `OLDOF_TRAITS`).
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITION_OLDOFS(func_traits) \\
- BOOST_PP_TUPLE_ELEM(3, 1, BOOST_PP_ARRAY_ELEM(21, func_traits))
-
-// Expand to pp-list of postcondition assertions.
-#define CONTRACT_DETAIL_PP_FUNC_TRAITS_POSTCONDITIONS(func_traits) \\
- BOOST_PP_TUPLE_ELEM(3, 2, BOOST_PP_ARRAY_ELEM(21, func_traits))
-
-#endif // #include guard
-
-'''.format(CONTRACT_LIMIT_OLDOFS, data(CONTRACT_LIMIT_OLDOFS)))
-
-h.close()
-print "Written:", header
-

Deleted: sandbox/contract/boost/contract/detail/preprocessor/tuple/split-generate.py
==============================================================================
--- sandbox/contract/boost/contract/detail/preprocessor/tuple/split-generate.py 2013-02-28 19:11:34 EST (Thu, 28 Feb 2013)
+++ (empty file)
@@ -1,85 +0,0 @@
-
-# Copyright (C) 2008-2012 Lorenzo Caminiti
-# Distributed under the Boost Software License, Version 1.0
-# (see accompanying file LICENSE_1_0.txt or a copy at
-# http://www.boost.org/LICENSE_1_0.txt)
-# Home at http://sourceforge.net/projects/contractpp
-
-import sys
-import shutil
-
-def placeholders(start, stop):
- (s, comma) = ('', '')
- for i in range(start, stop):
- (s, comma) = (s + comma + '_' + str(i + 1), ', ')
- return s
-
-def data(max_size):
- s = ''
- for size in range(1, max_size + 1):
- s = s + '''
-#define CONTRACT_DETAIL_PP_TUPLE_SPLIT_{0}({1}) \\
- ({1}) , /* comma splits */ \
-'''.format(size, placeholders(0, size))
- return s
-
-BOOST_PP_LIMIT_TUPLE = raw_input("BOOST_PP_LIMIT_TUPLE" +
- " from <boost/preprocessor/limit.hpp> [64] = ")
-if BOOST_PP_LIMIT_TUPLE == "": BOOST_PP_LIMIT_TUPLE = 64
-else: BOOST_PP_LIMIT_TUPLE = int(BOOST_PP_LIMIT_TUPLE)
-
-header = sys.argv[0].replace("-generate.py", ".hpp", 1)
-shutil.copyfile(header, header + ".bak")
-h = open(header, 'w')
-
-h.write('''
-#ifndef CONTRACT_DETAIL_PP_TUPLE_SPLIT_HPP_
-#define CONTRACT_DETAIL_PP_TUPLE_SPLIT_HPP_
-
-// WARNING: FILE AUTOMATICALLY GENERATED, DO NOT MODIFY IT!
-// Instead modify the generation script "<FILE>-generate.py" and run
-// `$ python <FILE_NAME>-generate.py > FILE_NAME.hpp`.
-// Used: #define BOOST_PP_LIMIT_TUPLE {0}
-
-#include <boost/preprocessor/limits.hpp>
-#if BOOST_PP_LIMIT_TUPLE != {0}
-#error "Code generation used incorrect BOOST_PP_LIMIT_TUPLE"
-#endif
-
-// PRIVATE //
-
-// Own version of PP_CAT for reentrancy.
-#if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
-# define CONTRACT_DETAIL_PP_TUPLE_SPLIT_CAT_(a, b) \\
- CONTRACT_DETAIL_PP_TUPLE_SPLIT_CAT_I_(a, b)
-#else
-# define CONTRACT_DETAIL_PP_TUPLE_SPLIT_CAT_(a, b) \\
- CONTRACT_DETAIL_PP_TUPLE_SPLIT_CAT_OO_((a, b))
-# define CONTRACT_DETAIL_PP_TUPLE_SPLIT_CAT_OO_(par) \\
- CONTRACT_DETAIL_PP_TUPLE_SPLIT_CAT_I_ ## par
-#endif
-#if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
-# define CONTRACT_DETAIL_PP_TUPLE_SPLIT_CAT_I_(a, b) \\
- a ## b
-#else
-# define CONTRACT_DETAIL_PP_TUPLE_SPLIT_CAT_I_(a, b) \\
- CONTRACT_DETAIL_PP_TUPLE_SPLIT_CAT_II_(~, a ## b)
-# define CONTRACT_DETAIL_PP_TUPLE_SPLIT_CAT_II_(p, res) \\
- res
-#endif
-
-// PUBLIC //
-
-#define CONTRACT_DETAIL_PP_TUPLE_SPLIT(size) \\
- CONTRACT_DETAIL_PP_TUPLE_SPLIT_CAT_(CONTRACT_DETAIL_PP_TUPLE_SPLIT_, size)
-
-// DATA //
-{1}
-
-#endif // #include guard
-
-'''.format(BOOST_PP_LIMIT_TUPLE, data(BOOST_PP_LIMIT_TUPLE)))
-
-h.close()
-print "Written", header
-

Deleted: sandbox/contract/boost/generate.py
==============================================================================
--- sandbox/contract/boost/generate.py 2013-02-28 19:11:34 EST (Thu, 28 Feb 2013)
+++ (empty file)
@@ -1,35 +0,0 @@
-
-# Copyright (C) 2008-2012 Lorenzo Caminiti
-# Distributed under the Boost Software License, Version 1.0
-# (see accompanying file LICENSE_1_0.txt or a copy at
-# http://www.boost.org/LICENSE_1_0.txt)
-# Home at http://sourceforge.net/projects/contractpp
-
-import os
-
-scripts = [
- ("contract/detail/preprocessor/array", "first_n-generate.py"),
- ("contract/detail/preprocessor/array", "rest_n-generate.py"),
- ("contract/detail/preprocessor/facilities", "is_digit-generate.py"),
- ("contract/detail/preprocessor/traits/aux_", "apply-generate.py"),
- ("contract/detail/preprocessor/traits/aux_", "list-generate.py"),
- ("contract/detail/preprocessor/traits/aux_",
- "select_assertion_-generate.py"),
- ("contract/detail/preprocessor/traits/func", "catches-generate.py"),
- ("contract/detail/preprocessor/traits/func", "postconditions-generate.py"),
- ("contract/detail/preprocessor/tuple", "split-generate.py"),
-]
-
-root = os.getcwd()
-for s in scripts:
- dir = s[0]
- cmd = "python " + s[1]
- print
- print dir + "$ " + cmd
- os.chdir(dir)
- os.system(cmd)
- os.chdir(root)
-
-print
-print "Done. (Add any missing generation Python script to this script.)",
-

Modified: sandbox/contract/libs/contract/example/contracts/push_back.cpp
==============================================================================
--- sandbox/contract/libs/contract/example/contracts/push_back.cpp (original)
+++ sandbox/contract/libs/contract/example/contracts/push_back.cpp 2013-02-28 19:11:34 EST (Thu, 28 Feb 2013)
@@ -8,23 +8,23 @@
 #include <boost/detail/lightweight_test.hpp>
 
 //[push_back
-#include <contract.hpp> // This library.
+#include <boost/contract.hpp> // This library.
 #include <boost/concept_check.hpp>
 #include <vector>
 #include "pushable.hpp" // Some base class.
 
-CONTRACT_CLASS(
+BOOST_CONTRACT_CLASS(
     template( typename T ) requires( boost::CopyConstructible<T> ) // Concepts.
     class (vector) extends( public pushable<T> ) // Subcontracting.
 ) {
- CONTRACT_CLASS_INVARIANT_TPL(
+ BOOST_CONTRACT_CLASS_INVARIANT_TPL(
         empty() == (size() == 0) // More class invariants here...
     )
 
     public: typedef typename std::vector<T>::size_type size_type;
     public: typedef typename std::vector<T>::const_reference const_reference;
 
- CONTRACT_FUNCTION_TPL(
+ BOOST_CONTRACT_FUNCTION_TPL(
         public void (push_back) ( (T const&) value ) override
             precondition(
                 size() < max_size() // More preconditions here...


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk