|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r71366 - in branches/release: . boost boost/algorithm/string boost/archive boost/bimap boost/config boost/date_time boost/date_time/posix_time boost/detail boost/filesystem boost/function boost/functional boost/functional/hash boost/fusion boost/fusion/container/list/detail boost/geometry boost/geometry/algorithms boost/geometry/arithmetic boost/geometry/core boost/geometry/domains boost/geometry/geometries boost/geometry/iterators boost/geometry/multi boost/geometry/policies boost/geometry/ranges boost/geometry/strategies boost/geometry/util boost/geometry/views boost/gil boost/graph boost/icl boost/integer boost/interprocess boost/intrusive boost/io boost/iostreams boost/iterator boost/math boost/msm boost/numeric/ublas boost/pool boost/program_options boost/program_options/detail boost/property_tree boost/python boost/range boost/regex boost/serialization boost/signals boost/signals2 boost/spirit boost/spirit/home boost/spirit/home/karma boost/spirit/home/support boost/statechart boost/system boost/thread boost/tr1 boost/type_traits boost/typeof boost/unordered boost/utility boost/uuid boost/variant boost/wave boost/wave/util doc libs libs/algorithm/string libs/array libs/array/test libs/bimap libs/config libs/date_time libs/date_time/data libs/date_time/example/gregorian libs/date_time/example/local_time libs/date_time/example/posix_time libs/date_time/example/tutorial libs/date_time/test/posix_time libs/date_time/xmldoc libs/detail libs/filesystem libs/function libs/functional libs/functional/hash libs/fusion libs/geometry libs/geometry/doc libs/geometry/doc/concept libs/geometry/doc/doxy libs/geometry/doc/generated libs/geometry/doc/html libs/geometry/doc/reference libs/geometry/doc/src libs/geometry/example libs/geometry/test libs/graph/doc libs/graph_parallel libs/icl libs/icl/doc libs/icl/doc/html libs/icl/doc/html/header/boost/icl libs/icl/test libs/icl/test/test_doc_code_ libs/integer libs/interprocess libs/intrusive libs/io libs/io/doc libs/iostreams libs/iterator libs/math libs/math/doc/sf_and_dist libs/math/doc/sf_and_dist/html/math_toolkit/main_overview libs/mpi/build libs/mpl/doc/refmanual libs/mpl/doc/src/refmanual libs/msm libs/numeric/ublas libs/numeric/ublas/doc libs/parameter/doc/html libs/phoenix/doc libs/phoenix/doc/examples libs/pool libs/program_options libs/program_options/test libs/property_tree libs/python libs/range libs/regex libs/serialization libs/serialization/doc libs/serialization/example libs/serialization/src libs/serialization/test libs/serialization/vc7ide libs/signals libs/signals2 libs/spirit libs/spirit/classic/example libs/spirit/doc libs/spirit/example libs/spirit/phoenix libs/spirit/test libs/spirit/test/qi libs/statechart libs/static_assert libs/system libs/thread libs/timer libs/tr1 libs/type_traits libs/type_traits/doc libs/typeof/doc libs/units/test libs/unordered libs/utility libs/utility/swap/test libs/uuid libs/wave libs/wave/samples/quick_start libs/wave/samples/quick_start/build libs/wave/test/testwave/testfiles more status tools tools/bcp tools/boostbook tools/build/v2 tools/inspect tools/quickbook tools/quickbook/doc tools/quickbook/src tools/quickbook/test tools/regression tools/regression/src tools/release tools/wave
From: hartmut.kaiser_at_[hidden]
Date: 2011-04-17 17:58:29
Author: hkaiser
Date: 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
New Revision: 71366
URL: http://svn.boost.org/trac/boost/changeset/71366
Log:
Wave: merging from trunk
Added:
branches/release/libs/wave/test/testwave/testfiles/t_9_020.cpp
- copied unchanged from r69196, /trunk/libs/wave/test/testwave/testfiles/t_9_020.cpp
Properties modified:
branches/release/ (props changed)
branches/release/INSTALL (props changed)
branches/release/Jamroot (props changed)
branches/release/LICENSE_1_0.txt (props changed)
branches/release/boost/ (props changed)
branches/release/boost-build.jam (props changed)
branches/release/boost.css (props changed)
branches/release/boost.png (props changed)
branches/release/boost/algorithm/string/ (props changed)
branches/release/boost/archive/ (props changed)
branches/release/boost/archive/basic_binary_iarchive.hpp (props changed)
branches/release/boost/array.hpp (props changed)
branches/release/boost/bimap/ (props changed)
branches/release/boost/concept_check.hpp (props changed)
branches/release/boost/config/ (props changed)
branches/release/boost/config.hpp (props changed)
branches/release/boost/date_time/c_time.hpp (props changed)
branches/release/boost/date_time/gregorian_calendar.ipp (props changed)
branches/release/boost/date_time/posix_time/time_serialize.hpp (props changed)
branches/release/boost/date_time/strings_from_facet.hpp (props changed)
branches/release/boost/date_time/time_facet.hpp (props changed)
branches/release/boost/detail/ (props changed)
branches/release/boost/filesystem/ (props changed)
branches/release/boost/filesystem.hpp (props changed)
branches/release/boost/function/ (props changed)
branches/release/boost/functional/ (props changed)
branches/release/boost/functional/hash/ (props changed)
branches/release/boost/fusion/ (props changed)
branches/release/boost/fusion/container/list/detail/build_cons.hpp (props changed)
branches/release/boost/geometry/ (props changed)
branches/release/boost/geometry/algorithms/ (props changed)
branches/release/boost/geometry/arithmetic/ (props changed)
branches/release/boost/geometry/core/ (props changed)
branches/release/boost/geometry/domains/ (props changed)
branches/release/boost/geometry/geometries/ (props changed)
branches/release/boost/geometry/geometry.hpp (props changed)
branches/release/boost/geometry/iterators/ (props changed)
branches/release/boost/geometry/multi/ (props changed)
branches/release/boost/geometry/policies/ (props changed)
branches/release/boost/geometry/ranges/ (props changed)
branches/release/boost/geometry/strategies/ (props changed)
branches/release/boost/geometry/util/ (props changed)
branches/release/boost/geometry/views/ (props changed)
branches/release/boost/gil/ (props changed)
branches/release/boost/graph/ (props changed)
branches/release/boost/icl/ (props changed)
branches/release/boost/integer/ (props changed)
branches/release/boost/interprocess/ (props changed)
branches/release/boost/intrusive/ (props changed)
branches/release/boost/io/ (props changed)
branches/release/boost/iostreams/ (props changed)
branches/release/boost/iterator/ (props changed)
branches/release/boost/iterator/iterator_facade.hpp (props changed)
branches/release/boost/math/ (props changed)
branches/release/boost/math_fwd.hpp (props changed)
branches/release/boost/msm/ (props changed)
branches/release/boost/numeric/ublas/ (props changed)
branches/release/boost/numeric/ublas/functional.hpp (props changed)
branches/release/boost/pool/ (props changed)
branches/release/boost/program_options/ (props changed)
branches/release/boost/program_options/detail/parsers.hpp (props changed)
branches/release/boost/program_options/parsers.hpp (props changed)
branches/release/boost/property_tree/ (props changed)
branches/release/boost/python/ (props changed)
branches/release/boost/range/ (props changed)
branches/release/boost/regex/ (props changed)
branches/release/boost/serialization/ (props changed)
branches/release/boost/signals/ (props changed)
branches/release/boost/signals2/ (props changed)
branches/release/boost/signals2.hpp (props changed)
branches/release/boost/spirit/ (props changed)
branches/release/boost/spirit/home/ (props changed)
branches/release/boost/spirit/home/karma/ (props changed)
branches/release/boost/spirit/home/support/attributes.hpp (props changed)
branches/release/boost/statechart/ (props changed)
branches/release/boost/static_assert.hpp (props changed)
branches/release/boost/system/ (props changed)
branches/release/boost/thread/ (props changed)
branches/release/boost/thread.hpp (props changed)
branches/release/boost/token_functions.hpp (props changed)
branches/release/boost/tr1/ (props changed)
branches/release/boost/type_traits/ (props changed)
branches/release/boost/typeof/message.hpp (props changed)
branches/release/boost/typeof/register_functions.hpp (props changed)
branches/release/boost/typeof/register_functions_iterate.hpp (props changed)
branches/release/boost/typeof/typeof.hpp (props changed)
branches/release/boost/typeof/unsupported.hpp (props changed)
branches/release/boost/unordered/ (props changed)
branches/release/boost/utility/ (props changed)
branches/release/boost/utility/value_init.hpp (props changed)
branches/release/boost/uuid/ (props changed)
branches/release/boost/variant/ (props changed)
branches/release/boost/version.hpp (props changed)
branches/release/boost/wave/ (props changed)
branches/release/bootstrap.bat (props changed)
branches/release/bootstrap.sh (props changed)
branches/release/doc/ (props changed)
branches/release/index.htm (props changed)
branches/release/index.html (props changed)
branches/release/libs/ (props changed)
branches/release/libs/algorithm/string/ (props changed)
branches/release/libs/array/ (props changed)
branches/release/libs/array/test/array0.cpp (props changed)
branches/release/libs/array/test/array2.cpp (props changed)
branches/release/libs/array/test/array6.cpp (props changed)
branches/release/libs/bimap/ (props changed)
branches/release/libs/config/ (props changed)
branches/release/libs/date_time/ (props changed)
branches/release/libs/date_time/data/date_time_zonespec.csv (props changed)
branches/release/libs/date_time/example/gregorian/days_between_new_years.cpp (props changed)
branches/release/libs/date_time/example/gregorian/days_since_year_start.cpp (props changed)
branches/release/libs/date_time/example/gregorian/days_till_new_year.cpp (props changed)
branches/release/libs/date_time/example/gregorian/month_add.cpp (props changed)
branches/release/libs/date_time/example/local_time/flight.cpp (props changed)
branches/release/libs/date_time/example/local_time/local_date_time.cpp (props changed)
branches/release/libs/date_time/example/posix_time/print_hours.cpp (props changed)
branches/release/libs/date_time/example/posix_time/time_math.cpp (props changed)
branches/release/libs/date_time/example/tutorial/io_tutorial.cpp (props changed)
branches/release/libs/date_time/test/posix_time/testtime_facet.cpp (props changed)
branches/release/libs/date_time/test/posix_time/testtime_input_facet.cpp (props changed)
branches/release/libs/date_time/xmldoc/date_class.xml (props changed)
branches/release/libs/date_time/xmldoc/usage_examples.xml (props changed)
branches/release/libs/detail/ (props changed)
branches/release/libs/filesystem/ (props changed)
branches/release/libs/function/ (props changed)
branches/release/libs/functional/ (props changed)
branches/release/libs/functional/hash/ (props changed)
branches/release/libs/fusion/ (props changed)
branches/release/libs/geometry/ (props changed)
branches/release/libs/geometry/doc/ (props changed)
branches/release/libs/geometry/doc/Jamfile.v2 (props changed)
branches/release/libs/geometry/doc/about_documentation.qbk (props changed)
branches/release/libs/geometry/doc/acknowledgments.qbk (props changed)
branches/release/libs/geometry/doc/concept/ (props changed)
branches/release/libs/geometry/doc/copyright_note_policy.txt (props changed)
branches/release/libs/geometry/doc/design_rationale.qbk (props changed)
branches/release/libs/geometry/doc/doxy/ (props changed)
branches/release/libs/geometry/doc/generated/ (props changed)
branches/release/libs/geometry/doc/geometry.qbk (props changed)
branches/release/libs/geometry/doc/html/ (props changed)
branches/release/libs/geometry/doc/imports.qbk (props changed)
branches/release/libs/geometry/doc/introduction.qbk (props changed)
branches/release/libs/geometry/doc/make_qbk.py (props changed)
branches/release/libs/geometry/doc/matrix.qbk (props changed)
branches/release/libs/geometry/doc/quickref.xml (props changed)
branches/release/libs/geometry/doc/quickstart.qbk (props changed)
branches/release/libs/geometry/doc/readme.txt (props changed)
branches/release/libs/geometry/doc/reference/ (props changed)
branches/release/libs/geometry/doc/reference.qbk (props changed)
branches/release/libs/geometry/doc/src/ (props changed)
branches/release/libs/geometry/example/ (props changed)
branches/release/libs/geometry/index.html (props changed)
branches/release/libs/geometry/test/ (props changed)
branches/release/libs/graph/doc/ (props changed)
branches/release/libs/graph_parallel/ (props changed)
branches/release/libs/icl/ (props changed)
branches/release/libs/icl/doc/ (props changed)
branches/release/libs/icl/doc/html/ (props changed)
branches/release/libs/icl/doc/html/header/boost/icl/ (props changed)
branches/release/libs/icl/test/ (props changed)
branches/release/libs/icl/test/test_doc_code_/ (props changed)
branches/release/libs/integer/ (props changed)
branches/release/libs/interprocess/ (props changed)
branches/release/libs/intrusive/ (props changed)
branches/release/libs/io/ (props changed)
branches/release/libs/io/doc/ (props changed)
branches/release/libs/iostreams/ (props changed)
branches/release/libs/iterator/ (props changed)
branches/release/libs/libraries.htm (props changed)
branches/release/libs/maintainers.txt (props changed)
branches/release/libs/math/ (props changed)
branches/release/libs/math/doc/sf_and_dist/faq.qbk (props changed)
branches/release/libs/math/doc/sf_and_dist/html/math_toolkit/main_overview/faq.html (props changed)
branches/release/libs/mpi/build/ (props changed)
branches/release/libs/mpl/doc/refmanual/broken-compiler-workarounds.html (props changed)
branches/release/libs/mpl/doc/refmanual/categorized-index-concepts.html (props changed)
branches/release/libs/mpl/doc/refmanual/cfg-no-preprocessed-headers.html (props changed)
branches/release/libs/mpl/doc/refmanual/composition-and-argument-binding.html (props changed)
branches/release/libs/mpl/doc/refmanual/data-types-concepts.html (props changed)
branches/release/libs/mpl/doc/refmanual/data-types-miscellaneous.html (props changed)
branches/release/libs/mpl/doc/refmanual/extensible-associative-sequence.html (props changed)
branches/release/libs/mpl/doc/refmanual/inserter-class.html (props changed)
branches/release/libs/mpl/doc/refmanual/tag-dispatched-metafunction.html (props changed)
branches/release/libs/mpl/doc/refmanual/trivial-metafunctions-summary.html (props changed)
branches/release/libs/mpl/doc/src/refmanual/Iterators-Iterator.rst (props changed)
branches/release/libs/msm/ (props changed)
branches/release/libs/numeric/ublas/ (props changed)
branches/release/libs/numeric/ublas/doc/ (props changed)
branches/release/libs/parameter/doc/html/index.html (props changed)
branches/release/libs/phoenix/doc/basics.qbk (props changed)
branches/release/libs/phoenix/doc/examples/extending_actors.qbk (props changed)
branches/release/libs/phoenix/doc/organisation.qbk (props changed)
branches/release/libs/pool/ (props changed)
branches/release/libs/program_options/ (props changed)
branches/release/libs/program_options/test/parsers_test.cpp (props changed)
branches/release/libs/property_tree/ (props changed)
branches/release/libs/python/ (props changed)
branches/release/libs/range/ (props changed)
branches/release/libs/regex/ (props changed)
branches/release/libs/serialization/ (props changed)
branches/release/libs/serialization/doc/ (props changed)
branches/release/libs/serialization/example/ (props changed)
branches/release/libs/serialization/src/ (props changed)
branches/release/libs/serialization/test/test_diamond_complex.cpp (props changed)
branches/release/libs/serialization/vc7ide/ (props changed)
branches/release/libs/signals/ (props changed)
branches/release/libs/signals2/ (props changed)
branches/release/libs/spirit/ (props changed)
branches/release/libs/spirit/classic/example/ (props changed)
branches/release/libs/spirit/doc/ (props changed)
branches/release/libs/spirit/example/ (props changed)
branches/release/libs/spirit/phoenix/ (props changed)
branches/release/libs/spirit/test/ (props changed)
branches/release/libs/spirit/test/qi/optional.cpp (props changed)
branches/release/libs/statechart/ (props changed)
branches/release/libs/static_assert/ (props changed)
branches/release/libs/system/ (props changed)
branches/release/libs/thread/ (props changed)
branches/release/libs/timer/ (props changed)
branches/release/libs/tr1/ (props changed)
branches/release/libs/type_traits/ (props changed)
branches/release/libs/type_traits/doc/ (props changed)
branches/release/libs/typeof/doc/typeof.qbk (props changed)
branches/release/libs/units/test/ (props changed)
branches/release/libs/unordered/ (props changed)
branches/release/libs/utility/ (props changed)
branches/release/libs/utility/assert.html (props changed)
branches/release/libs/utility/assert_test.cpp (props changed)
branches/release/libs/utility/swap.html (props changed)
branches/release/libs/utility/swap/test/std_bitset.cpp (props changed)
branches/release/libs/utility/value_init.htm (props changed)
branches/release/libs/utility/value_init_test.cpp (props changed)
branches/release/libs/uuid/ (props changed)
branches/release/libs/wave/ (props changed)
branches/release/more/ (props changed)
branches/release/rst.css (props changed)
branches/release/status/ (props changed)
branches/release/status/Jamfile.v2 (props changed)
branches/release/status/explicit-failures-markup.xml (props changed)
branches/release/tools/ (props changed)
branches/release/tools/bcp/ (props changed)
branches/release/tools/boostbook/ (props changed)
branches/release/tools/build/v2/ (props changed)
branches/release/tools/inspect/ (props changed)
branches/release/tools/quickbook/ (props changed)
branches/release/tools/quickbook/doc/ (props changed)
branches/release/tools/quickbook/src/ (props changed)
branches/release/tools/quickbook/test/ (props changed)
branches/release/tools/regression/ (props changed)
branches/release/tools/regression/src/library_status.cpp (props changed)
branches/release/tools/release/ (props changed)
branches/release/tools/wave/ (props changed)
Text files modified:
branches/release/boost/wave/cpp_context.hpp | 12 +++--
branches/release/boost/wave/preprocessing_hooks.hpp | 75 +++++++++++++++++++++++++++++++++++----
branches/release/boost/wave/util/cpp_include_paths.hpp | 6 +-
branches/release/boost/wave/util/cpp_iterator.hpp | 15 ++-----
branches/release/boost/wave/util/cpp_macromap.hpp | 1
branches/release/boost/wave/util/cpp_macromap_predef.hpp | 2
branches/release/boost/wave/util/cpp_macromap_utils.hpp | 50 ++++++++++++++------------
branches/release/boost/wave/util/macro_helpers.hpp | 30 ++++++++--------
branches/release/boost/wave/util/unput_queue_iterator.hpp | 2
branches/release/libs/wave/ChangeLog | 9 ++++
branches/release/libs/wave/samples/quick_start/build/Jamfile.v2 | 2
branches/release/libs/wave/samples/quick_start/quick_start.cpp | 52 ++++++++++++++-------------
branches/release/libs/wave/test/testwave/testfiles/t_1_001.cpp | 28 ++++++++++----
branches/release/libs/wave/test/testwave/testfiles/t_1_006.cpp | 7 +--
branches/release/libs/wave/test/testwave/testfiles/t_1_007.cpp | 6 +-
branches/release/libs/wave/test/testwave/testfiles/t_1_008.cpp | 12 +++---
branches/release/libs/wave/test/testwave/testfiles/t_1_013.cpp | 2
branches/release/libs/wave/test/testwave/testfiles/t_1_030.cpp | 2
branches/release/libs/wave/test/testwave/testfiles/t_1_034.cpp | 8 ++--
branches/release/libs/wave/test/testwave/testfiles/t_1_038.cpp | 4 +-
branches/release/libs/wave/test/testwave/testfiles/t_5_030.cpp | 4 +-
branches/release/libs/wave/test/testwave/testfiles/t_9_010.cpp | 4 +-
branches/release/libs/wave/test/testwave/testfiles/t_9_012.cpp | 6 +-
branches/release/libs/wave/test/testwave/testfiles/test.cfg | 1
branches/release/tools/wave/trace_macro_expansion.hpp | 66 ++++++++++++++++++++++++++++++++++
25 files changed, 276 insertions(+), 130 deletions(-)
Modified: branches/release/boost/wave/cpp_context.hpp
==============================================================================
--- branches/release/boost/wave/cpp_context.hpp (original)
+++ branches/release/boost/wave/cpp_context.hpp 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -291,6 +291,9 @@
}
boost::wave::language_support get_language() const { return language; }
+ position_type &get_main_pos() { return macros.get_main_pos(); }
+ position_type const& get_main_pos() const { return macros.get_main_pos(); }
+
// change and ask for maximal possible include nesting depth
void set_max_include_nesting_depth(iter_size_type new_depth)
{ iter_ctxs.set_max_include_nesting_depth(new_depth); }
@@ -337,9 +340,6 @@
{ return macros.is_defined(begin, end); }
// maintain include paths (helper functions)
- bool find_include_file (std::string &s, std::string &d, bool is_system,
- char const *current_file) const
- { return includes.find_include_file(s, d, is_system, current_file); }
void set_current_directory(char const *path_)
{ includes.set_current_directory(path_); }
@@ -364,8 +364,6 @@
void push_iteration_context(position_type const &act_pos, iteration_ptr_type iter_ctx)
{ iter_ctxs.push(*this, act_pos, iter_ctx); }
- position_type &get_main_pos() { return macros.get_main_pos(); }
-
///////////////////////////////////////////////////////////////////////////////
//
// expand_tokensequence():
@@ -429,6 +427,10 @@
std::string const &get_current_relative_filename() const
{ return current_relative_filename; }
+ bool find_include_file (std::string &s, std::string &d, bool is_system,
+ char const *current_file) const
+ { return includes.find_include_file(s, d, is_system, current_file); }
+
#if BOOST_WAVE_SERIALIZATION != 0
public:
BOOST_STATIC_CONSTANT(unsigned int, version = 0x10);
Modified: branches/release/boost/wave/preprocessing_hooks.hpp
==============================================================================
--- branches/release/boost/wave/preprocessing_hooks.hpp (original)
+++ branches/release/boost/wave/preprocessing_hooks.hpp 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -12,6 +12,8 @@
#define DEFAULT_PREPROCESSING_HOOKS_HPP_INCLUDED
#include <boost/wave/wave_config.hpp>
+#include <boost/wave/util/cpp_include_paths.hpp>
+
#include <vector>
// this must occur after all of the includes and before any code appears
@@ -56,7 +58,7 @@
// invocation (starting with the opening parenthesis and ending after the
// closing one).
//
- // The return value defines, whether the corresponding macro will be
+ // The return value defines whether the corresponding macro will be
// expanded (return false) or will be copied to the output (return true).
// Note: the whole argument list is copied unchanged to the output as well
// without any further processing.
@@ -99,7 +101,7 @@
//
// The parameter 'macrocall' marks the position, where this macro invoked.
//
- // The return value defines, whether the corresponding macro will be
+ // The return value defines whether the corresponding macro will be
// expanded (return false) or will be copied to the output (return true).
//
///////////////////////////////////////////////////////////////////////////
@@ -168,6 +170,63 @@
///////////////////////////////////////////////////////////////////////////
//
+ // The function 'locate_include_file' is called, whenever a #include
+ // directive was encountered. It is supposed to locate the given file and
+ // should return the full file name of the located file. This file name
+ // is expected to uniquely identify the referenced file.
+ //
+ // The parameter 'ctx' is a reference to the context object used for
+ // instantiating the preprocessing iterators by the user.
+ //
+ // The parameter 'file_path' contains the (expanded) file name found after
+ // the #include directive. This parameter holds the string as it is
+ // specified in the #include directive, i.e. <file> or "file" will result
+ // in a parameter value 'file'.
+ //
+ // The parameter 'is_system' is set to 'true' if this call happens as a
+ // result of a #include '<file>' directive, it is 'false' otherwise, i.e.
+ // for #include "file" directives.
+ //
+ // The parameter 'current_name' is only used if a #include_next directive
+ // was encountered (and BOOST_WAVE_SUPPORT_INCLUDE_NEXT was defined to be
+ // non-zero). In this case it points to unique full name of the current
+ // include file (if any). Otherwise this parameter is set to NULL.
+ //
+ // The parameter 'dir_path' on return is expected to hold the directory
+ // part of the located file.
+ //
+ // The parameter 'native_name' on return is expected to hold the unique
+ // full file name of the located file.
+ //
+ // The return value defines whether the file was located successfully.
+ //
+ ///////////////////////////////////////////////////////////////////////////
+ template <typename ContextT>
+ bool
+ locate_include_file(ContextT& ctx, std::string &file_path,
+ bool is_system, char const *current_name, std::string &dir_path,
+ std::string &native_name)
+ {
+ if (!ctx.find_include_file (file_path, dir_path, is_system, current_name))
+ return false; // could not locate file
+
+ namespace fs = boost::filesystem;
+
+ fs::path native_path(wave::util::create_path(file_path));
+ if (!fs::exists(native_path)) {
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, bad_include_file,
+ file_path.c_str(), ctx.get_main_pos());
+ return false;
+ }
+
+ // return the unique full file system path of the located file
+ native_name = wave::util::native_file_string(native_path);
+
+ return true; // include file has been located successfully
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ //
// The function 'found_include_directive' is called, whenever a #include
// directive was located.
//
@@ -185,7 +244,7 @@
// a #include_next directive and the BOOST_WAVE_SUPPORT_INCLUDE_NEXT
// preprocessing constant was defined to something != 0.
//
- // The return value defines, whether the found file will be included
+ // The return value defines whether the found file will be included
// (return false) or will be skipped (return true).
//
///////////////////////////////////////////////////////////////////////////
@@ -204,7 +263,7 @@
return false; // ok to include this file
}
#endif
-
+
///////////////////////////////////////////////////////////////////////////
//
// The function 'opened_include_file' is called, whenever a file referred
@@ -220,7 +279,7 @@
//
// The include_depth parameter contains the current include file depth.
//
- // The is_system_include parameter denotes, whether the given file was
+ // The is_system_include parameter denotes whether the given file was
// found as a result of a #include <...> directive.
//
///////////////////////////////////////////////////////////////////////////
@@ -485,7 +544,7 @@
// The parameter 'directive' is a reference to the token holding the
// preprocessing directive.
//
- // The return value defines, whether the given expression has to be
+ // The return value defines whether the given expression has to be
// to be executed in a normal way (return 'false'), or if it has to be
// skipped altogether (return 'true'), which means it gets replaced in the
// output by a single newline.
@@ -520,7 +579,7 @@
// stream, which are to be used as the replacement text for the whole
// line containing the unknown directive.
//
- // The return value defines, whether the given expression has been
+ // The return value defines whether the given expression has been
// properly interpreted by the hook function or not. If this function
// returns 'false', the library will raise an 'ill_formed_directive'
// preprocess_exception. Otherwise the tokens pushed back into 'pending'
@@ -551,7 +610,7 @@
// The parameter expression_value contains the result of the evaluation of
// the expression in the current preprocessing context.
//
- // The return value defines, whether the given expression has to be
+ // The return value defines whether the given expression has to be
// evaluated again, allowing to decide which of the conditional branches
// should be expanded. You need to return 'true' from this hook function
// to force the expression to be re-evaluated.
Modified: branches/release/boost/wave/util/cpp_include_paths.hpp
==============================================================================
--- branches/release/boost/wave/util/cpp_include_paths.hpp (original)
+++ branches/release/boost/wave/util/cpp_include_paths.hpp 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -182,7 +182,7 @@
public:
bool has_pragma_once(std::string const &filename)
{
- using namespace boost::multi_index;
+ using boost::multi_index::get;
return get<from>(pragma_once_files).find(filename) != pragma_once_files.end();
}
bool add_pragma_once_header(std::string const &filename,
@@ -198,7 +198,7 @@
range_type r = pragma_once_files.get<to>().equal_range(guard_name);
if (r.first != r.second) {
- using namespace boost::multi_index;
+ using boost::multi_index::get;
get<to>(pragma_once_files).erase(r.first, r.second);
return true;
}
@@ -334,7 +334,7 @@
dirpath = create_path((*it).second);
dirpath /= create_path(s);
}
-
+
dir = dirpath.string();
s = normalize(currpath).string(); // found the required file
return true;
Modified: branches/release/boost/wave/util/cpp_iterator.hpp
==============================================================================
--- branches/release/boost/wave/util/cpp_iterator.hpp (original)
+++ branches/release/boost/wave/util/cpp_iterator.hpp 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -1576,24 +1576,19 @@
#endif
file_path = util::impl::unescape_lit(file_path);
- if (!ctx.find_include_file (file_path, dir_path, is_system, current_name)) {
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, bad_include_file,
- file_path.c_str(), act_pos);
- return false;
- }
-
-fs::path native_path(wave::util::create_path(file_path));
+ std::string native_path_str;
- if (!fs::exists(native_path)) {
+ if (!ctx.get_hooks().locate_include_file(ctx, file_path, is_system,
+ current_name, dir_path, native_path_str))
+ {
BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, bad_include_file,
file_path.c_str(), act_pos);
return false;
}
// test, if this file is known through a #pragma once directive
- std::string native_path_str(wave::util::native_file_string(native_path));
#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0
- if (!ctx.has_pragma_once(native_path.string()))
+ if (!ctx.has_pragma_once(native_path_str))
#endif
{
// the new include file determines the actual current directory
Modified: branches/release/boost/wave/util/cpp_macromap.hpp
==============================================================================
--- branches/release/boost/wave/util/cpp_macromap.hpp (original)
+++ branches/release/boost/wave/util/cpp_macromap.hpp 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -140,6 +140,7 @@
void reset_macromap();
position_type &get_main_pos() { return main_pos; }
+ position_type const& get_main_pos() const { return main_pos; }
// interface for macro name introspection
typedef typename defined_macros_type::name_iterator name_iterator;
Modified: branches/release/boost/wave/util/cpp_macromap_predef.hpp
==============================================================================
--- branches/release/boost/wave/util/cpp_macromap_predef.hpp (original)
+++ branches/release/boost/wave/util/cpp_macromap_predef.hpp 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -229,7 +229,7 @@
{
static static_macros data[] = {
{ "__STDC__", T_INTLIT, "1" },
- { "__cplusplus", T_INTLIT, "201101L" },
+ { "__cplusplus", T_INTLIT, "201103L" },
{ "__STDC_VERSION__", T_INTLIT, "199901L" },
{ "__STDC_HOSTED__", T_INTLIT, "0" },
{ "__WAVE_HAS_VARIADICS__", T_INTLIT, "1" },
Modified: branches/release/boost/wave/util/cpp_macromap_utils.hpp
==============================================================================
--- branches/release/boost/wave/util/cpp_macromap_utils.hpp (original)
+++ branches/release/boost/wave/util/cpp_macromap_utils.hpp 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -285,7 +285,8 @@
typename ContainerT::iterator it = replacement_list.begin();
while (it != end && IS_CATEGORY(*it, WhiteSpaceTokenType)) {
- if (T_PLACEHOLDER != token_id(*it)) {
+ token_id id(*it);
+ if (T_PLACEHOLDER != id && T_PLACEMARKER != id) {
typename ContainerT::iterator next = it;
++next;
replacement_list.erase(it);
@@ -309,7 +310,8 @@
typename ContainerT::iterator it = rit.base();
while (it != end && IS_CATEGORY(*it, WhiteSpaceTokenType)) {
- if (T_PLACEHOLDER != token_id(*it)) {
+ token_id id(*it);
+ if (T_PLACEHOLDER != id && T_PLACEMARKER != id) {
typename ContainerT::iterator next = it;
++next;
replacement_list.erase(it);
@@ -324,6 +326,25 @@
///////////////////////////////////////////////////////////////////////////////
//
+// Tests, whether the given token sequence consists out of whitespace only
+//
+///////////////////////////////////////////////////////////////////////////////
+template <typename ContainerT>
+inline bool
+is_whitespace_only (ContainerT const &argument)
+{
+ typename ContainerT::const_iterator end = argument.end();
+ for (typename ContainerT::const_iterator it = argument.begin();
+ it != end; ++it)
+ {
+ if (!IS_CATEGORY(*it, WhiteSpaceTokenType))
+ return false;
+ }
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+//
// Remove all placeholder tokens from the given token sequence
//
///////////////////////////////////////////////////////////////////////////////
@@ -339,7 +360,8 @@
typename ContainerT::iterator it = replacement_list.begin();
while (it != end) {
- if (T_PLACEHOLDER == token_id(*it)) {
+ token_id id(*it);
+ if (T_PLACEHOLDER == id || T_PLACEMARKER == id) {
typename ContainerT::iterator next = it;
++next;
replacement_list.erase(it);
@@ -351,7 +373,8 @@
}
// remove all 'new' leading and trailing whitespace
- trim_replacement_list(replacement_list);
+ if (is_whitespace_only(replacement_list))
+ trim_replacement_list(replacement_list);
}
}
@@ -408,25 +431,6 @@
}
///////////////////////////////////////////////////////////////////////////////
-//
-// Tests, whether the given token sequence consists out of whitespace only
-//
-///////////////////////////////////////////////////////////////////////////////
-template <typename ContainerT>
-inline bool
-is_whitespace_only (ContainerT const &argument)
-{
- typename ContainerT::const_iterator end = argument.end();
- for (typename ContainerT::const_iterator it = argument.begin();
- it != end; ++it)
- {
- if (!IS_CATEGORY(*it, WhiteSpaceTokenType))
- return false;
- }
- return true;
-}
-
-///////////////////////////////////////////////////////////////////////////////
// call 'skipped_token' preprocessing hook
template <typename ContextT>
void call_skipped_token_hook(ContextT& ctx,
Modified: branches/release/boost/wave/util/macro_helpers.hpp
==============================================================================
--- branches/release/boost/wave/util/macro_helpers.hpp (original)
+++ branches/release/boost/wave/util/macro_helpers.hpp 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -71,18 +71,18 @@
result = result + value.substr(pos, pos1-pos);
pos1 = value.find_first_of ("\\", (pos = pos1+1)+1);
break;
-
+
case 'n':
result = result + value.substr(pos, pos1-pos) + "\n";
pos1 = value.find_first_of ("\\", pos = pos1+1);
++pos;
break;
-
+
default:
result = result + value.substr(pos, pos1-pos+1);
pos1 = value.find_first_of ("\\", pos = pos1+1);
}
-
+
} while (pos1 != StringT::npos);
result = result + value.substr(pos);
}
@@ -92,7 +92,7 @@
}
return result;
}
-
+
// return the string representation of a token sequence
template <typename ContainerT, typename PositionT>
inline typename ContainerT::value_type::string_type
@@ -100,7 +100,7 @@
{
using namespace boost::wave;
typedef typename ContainerT::value_type::string_type string_type;
-
+
string_type result("\"");
bool was_whitespace = false;
typename ContainerT::const_iterator end = token_sequence.end();
@@ -108,7 +108,7 @@
it != end; ++it)
{
token_id id = token_id(*it);
-
+
if (IS_CATEGORY(*it, WhiteSpaceTokenType) || T_NEWLINE == id) {
if (!was_whitespace) {
// C++ standard 16.3.2.2 [cpp.stringize]
@@ -152,12 +152,12 @@
{
using namespace boost::wave;
typedef typename ContainerT::value_type::string_type string_type;
-
+
BOOST_ASSERT(i < arguments.size());
-
+
string_type result("\"");
bool was_whitespace = false;
-
+
for (/**/; i < arguments.size(); ++i) {
// stringize all remaining arguments
typename ContainerT::const_iterator end = arguments[i].end();
@@ -187,7 +187,7 @@
was_whitespace = false;
}
}
-
+
// append comma, if not last argument
if (i < arguments.size()-1) {
result += ",";
@@ -216,7 +216,7 @@
}
return result;
}
-
+
// return the string representation of a token sequence
template <typename ContainerT>
inline typename ContainerT::value_type::string_type
@@ -226,7 +226,7 @@
return as_string<string_type>(token_sequence.begin(),
token_sequence.end());
}
-
+
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
///////////////////////////////////////////////////////////////////////////
//
@@ -244,7 +244,7 @@
token_type comma(T_COMMA, ",", pos);
for (/**/; index < arguments.size(); ++index) {
ContainerT const &arg = arguments[index];
-
+
std::copy(arg.begin(), arg.end(),
std::inserter(expanded, expanded.end()));
@@ -270,13 +270,13 @@
++first;
return id;
}
-
+
template <typename IteratorT, typename ContainerT>
inline boost::wave::token_id
skip_whitespace(IteratorT &first, IteratorT const &last, ContainerT &queue)
{
queue.push_back (*first); // queue up the current token
-
+
token_id id = util::impl::next_token<IteratorT>::peek(first, last, false);
if (IS_CATEGORY(id, WhiteSpaceTokenType)) {
do {
Modified: branches/release/boost/wave/util/unput_queue_iterator.hpp
==============================================================================
--- branches/release/boost/wave/util/unput_queue_iterator.hpp (original)
+++ branches/release/boost/wave/util/unput_queue_iterator.hpp 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -240,7 +240,7 @@
typename iterator_type::container_type::iterator cit = queue.begin();
typename iterator_type::container_type::iterator cend = queue.end();
- if (skip_whitespace) {
+ if (skip_whitespace) {
for (++cit; cit != cend; ++cit) {
if (!IS_CATEGORY(*cit, WhiteSpaceTokenType) &&
T_NEWLINE != token_id(*cit))
Modified: branches/release/libs/wave/ChangeLog
==============================================================================
--- branches/release/libs/wave/ChangeLog (original)
+++ branches/release/libs/wave/ChangeLog 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -20,6 +20,15 @@
CHANGELOG
+Boost V1.47.0
+- V2.3.0
+- After preprocessing the body of any #pragma wave option() the wave tool now
+ concatenates all adjacent string literals into a single string literal.
+- Fixed whitespace handling, added a corresponding set of test cases
+ (t_9_020.cpp)
+- Added a new preprocessing hook: locate_include_file allowing to customize the
+ way include files are located.
+
Boost V1.46.0
- V2.2.0
- Added recognition of C++0x keywords to Re2C lexers.
Modified: branches/release/libs/wave/samples/quick_start/build/Jamfile.v2
==============================================================================
--- branches/release/libs/wave/samples/quick_start/build/Jamfile.v2 (original)
+++ branches/release/libs/wave/samples/quick_start/build/Jamfile.v2 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -4,7 +4,7 @@
#
# http://www.boost.org/
#
-# Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost
+# Copyright (c) 2001-2011 Hartmut Kaiser. 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)
Modified: branches/release/libs/wave/samples/quick_start/quick_start.cpp
==============================================================================
--- branches/release/libs/wave/samples/quick_start/quick_start.cpp (original)
+++ branches/release/libs/wave/samples/quick_start/quick_start.cpp 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2011 Hartmut Kaiser. 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)
=============================================================================*/
@@ -36,10 +36,10 @@
try {
//[quick_start_main
- // The following preprocesses the given input file (given by argv[1]).
+ // The following preprocesses the input file given by argv[1].
// Open and read in the specified input file.
- std::ifstream instream(argv[1]);
- std::string instring;
+ std::ifstream instream(argv[1]);
+ std::string instring;
if (!instream.is_open()) {
std::cerr << "Could not open input file: " << argv[1] << std::endl;
@@ -48,40 +48,42 @@
instream.unsetf(std::ios::skipws);
instring = std::string(std::istreambuf_iterator<char>(instream.rdbuf()),
std::istreambuf_iterator<char>());
-
- // This token type is one of the central types used throughout the library,
- // because it is a template parameter to some of the public classes and
- // instances of this type are returned from the iterators.
+
+ // This token type is one of the central types used throughout the library.
+ // It is a template parameter to some of the public classes and instances
+ // of this type are returned from the iterators.
typedef boost::wave::cpplexer::lex_token<> token_type;
-
+
// The template boost::wave::cpplexer::lex_iterator<> is the lexer type to
// to use as the token source for the preprocessing engine. It is
// parametrized with the token type.
typedef boost::wave::cpplexer::lex_iterator<token_type> lex_iterator_type;
-
- // This is the resulting context type to use. The first template parameter
- // should match the iterator type to be used during construction of the
- // corresponding context object (see below).
+
+ // This is the resulting context type. The first template parameter should
+ // match the iterator type used during construction of the context
+ // instance (see below). It is the type of the underlying input stream.
typedef boost::wave::context<std::string::iterator, lex_iterator_type>
context_type;
// The preprocessor iterator shouldn't be constructed directly. It is
- // to be generated through a wave::context<> object. This wave:context<>
- // object is to be used additionally to initialize and define different
- // parameters of the actual preprocessing (not done here).
+ // generated through a wave::context<> object. This wave:context<> object
+ // is additionally used to initialize and define different parameters of
+ // the actual preprocessing (not done here).
//
// The preprocessing of the input stream is done on the fly behind the
- // scenes during iteration over the context_type::iterator_type stream.
- context_type ctx (instring.begin(), instring.end(), argv[1]);
-
- // Get the preprocessor iterators and use them to generate
- // the token sequence.
- context_type::iterator_type first = ctx.begin();
- context_type::iterator_type last = ctx.end();
-
+ // scenes during iteration over the range of context_type::iterator_type
+ // instances.
+ context_type ctx (instring.begin(), instring.end(), argv[1]);
+
+ // Get the preprocessor iterators and use them to generate the token
+ // sequence.
+ context_type::iterator_type first = ctx.begin();
+ context_type::iterator_type last = ctx.end();
// The input stream is preprocessed for you while iterating over the range
- // [first, last)
+ // [first, last). The dereferenced iterator returns tokens holding
+ // information about the preprocessed input stream, such as token type,
+ // token value, and position.
while (first != last) {
current_position = (*first).get_position();
std::cout << (*first).get_value();
Modified: branches/release/libs/wave/test/testwave/testfiles/t_1_001.cpp
==============================================================================
--- branches/release/libs/wave/test/testwave/testfiles/t_1_001.cpp (original)
+++ branches/release/libs/wave/test/testwave/testfiles/t_1_001.cpp 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -8,25 +8,35 @@
=============================================================================*/
// Test macro expansion order
-#define A(x, y) x, y
+#define A(x, y) x,y
#define B(x, y) [x][y]
#define C(x) B(x)
//R #line 16 "t_1_001.cpp"
-C( A(2, 3) ) //R [2][3]
+C(A(2,3)) //R [2][3]
+C( A(2 , 3) ) //R [ 2 ][ 3 ]
//H 10: t_1_001.cpp(11): #define
-//H 08: t_1_001.cpp(11): A(x, y)=x, y
+//H 08: t_1_001.cpp(11): A(x, y)=x,y
//H 10: t_1_001.cpp(12): #define
//H 08: t_1_001.cpp(12): B(x, y)=[x][y]
//H 10: t_1_001.cpp(13): #define
//H 08: t_1_001.cpp(13): C(x)=B(x)
-//H 00: t_1_001.cpp(16): C( A(2, 3) ), [t_1_001.cpp(13): C(x)=B(x)]
-//H 00: t_1_001.cpp(16): A(2, 3), [t_1_001.cpp(11): A(x, y)=x, y]
-//H 02: 2, 3
-//H 03: 2, 3
-//H 02: B(2, 3)
-//H 00: t_1_001.cpp(13): B(2, 3), [t_1_001.cpp(12): B(x, y)=[x][y]]
+//H 00: t_1_001.cpp(16): C(A(2,3)), [t_1_001.cpp(13): C(x)=B(x)]
+//H 00: t_1_001.cpp(16): A(2,3), [t_1_001.cpp(11): A(x, y)=x,y]
+//H 02: 2,3
+//H 03: 2,3
+//H 02: B(2,3)
+//H 00: t_1_001.cpp(13): B(2,3), [t_1_001.cpp(12): B(x, y)=[x][y]]
//H 02: [2][3]
//H 03: [2][3]
//H 03: [2][3]
+//H 00: t_1_001.cpp(17): C( A(2 , 3) ), [t_1_001.cpp(13): C(x)=B(x)]
+//H 00: t_1_001.cpp(17): A(2 , 3), [t_1_001.cpp(11): A(x, y)=x,y]
+//H 02: 2 , 3
+//H 03: 2 , 3
+//H 02: B( 2 , 3 )
+//H 00: t_1_001.cpp(13): B( 2 , 3 ), [t_1_001.cpp(12): B(x, y)=[x][y]]
+//H 02: [ 2 ][ 3 ]
+//H 03: [ 2 ][ 3 ]
+//H 03: [ 2 ][ 3 ]
Modified: branches/release/libs/wave/test/testwave/testfiles/t_1_006.cpp
==============================================================================
--- branches/release/libs/wave/test/testwave/testfiles/t_1_006.cpp (original)
+++ branches/release/libs/wave/test/testwave/testfiles/t_1_006.cpp 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -32,19 +32,19 @@
//H 00: t_1_006.cpp(18): PRIMITIVE_CONCAT(2, 3), [t_1_006.cpp(14): PRIMITIVE_CONCAT(a, b)=a ## b]
//H 02: 23
//H 03: 23
-//H 02: PRIMITIVE_CONCAT(1, 23)
+//H 02: PRIMITIVE_CONCAT(1, 23)
//H 00: t_1_006.cpp(13): PRIMITIVE_CONCAT(1, 23), [t_1_006.cpp(14): PRIMITIVE_CONCAT(a, b)=a ## b]
//H 02: 123
//H 03: 123
//H 03: 123
//H 00: t_1_006.cpp(21): CONCAT(1, CONCAT(2, 3)), [t_1_006.cpp(13): CONCAT(a, b)=PRIMITIVE_CONCAT(a, b)]
//H 00: t_1_006.cpp(21): CONCAT(2, 3), [t_1_006.cpp(13): CONCAT(a, b)=PRIMITIVE_CONCAT(a, b)]
-//H 02: PRIMITIVE_CONCAT(2, 3)
+//H 02: PRIMITIVE_CONCAT(2, 3)
//H 00: t_1_006.cpp(13): PRIMITIVE_CONCAT(2, 3), [t_1_006.cpp(14): PRIMITIVE_CONCAT(a, b)=a ## b]
//H 02: 23
//H 03: 23
//H 03: 23
-//H 02: PRIMITIVE_CONCAT(1, 23)
+//H 02: PRIMITIVE_CONCAT(1, 23)
//H 00: t_1_006.cpp(13): PRIMITIVE_CONCAT(1, 23), [t_1_006.cpp(14): PRIMITIVE_CONCAT(a, b)=a ## b]
//H 02: 123
//H 03: 123
@@ -52,4 +52,3 @@
//H 00: t_1_006.cpp(25): PRIMITIVE_CONCAT(1, CONCAT(2, 3)), [t_1_006.cpp(14): PRIMITIVE_CONCAT(a, b)=a ## b]
//H 02: 1CONCAT(2, 3)
//H 03: 1CONCAT(2, 3)
-
Modified: branches/release/libs/wave/test/testwave/testfiles/t_1_007.cpp
==============================================================================
--- branches/release/libs/wave/test/testwave/testfiles/t_1_007.cpp (original)
+++ branches/release/libs/wave/test/testwave/testfiles/t_1_007.cpp 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -33,19 +33,19 @@
//H 00: t_1_007.cpp(20): PRIMITIVE_CONCAT(2, 3), [t_1_007.cpp(16): PRIMITIVE_CONCAT(a, b)=a ## b]
//H 02: 23
//H 03: 23
-//H 02: PRIMITIVE_CONCAT(1, 23)
+//H 02: PRIMITIVE_CONCAT(1, 23)
//H 00: t_1_007.cpp(15): PRIMITIVE_CONCAT(1, 23), [t_1_007.cpp(16): PRIMITIVE_CONCAT(a, b)=a ## b]
//H 02: 123
//H 03: 123
//H 03: 123
//H 00: t_1_007.cpp(23): CONCAT(1, CONCAT(2, 3)), [t_1_007.cpp(15): CONCAT(a, b)=PRIMITIVE_CONCAT(a, b)]
//H 00: t_1_007.cpp(23): CONCAT(2, 3), [t_1_007.cpp(15): CONCAT(a, b)=PRIMITIVE_CONCAT(a, b)]
-//H 02: PRIMITIVE_CONCAT(2, 3)
+//H 02: PRIMITIVE_CONCAT(2, 3)
//H 00: t_1_007.cpp(15): PRIMITIVE_CONCAT(2, 3), [t_1_007.cpp(16): PRIMITIVE_CONCAT(a, b)=a ## b]
//H 02: 23
//H 03: 23
//H 03: 23
-//H 02: PRIMITIVE_CONCAT(1, 23)
+//H 02: PRIMITIVE_CONCAT(1, 23)
//H 00: t_1_007.cpp(15): PRIMITIVE_CONCAT(1, 23), [t_1_007.cpp(16): PRIMITIVE_CONCAT(a, b)=a ## b]
//H 02: 123
//H 03: 123
Modified: branches/release/libs/wave/test/testwave/testfiles/t_1_008.cpp
==============================================================================
--- branches/release/libs/wave/test/testwave/testfiles/t_1_008.cpp (original)
+++ branches/release/libs/wave/test/testwave/testfiles/t_1_008.cpp 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -78,8 +78,8 @@
//H 01: t_1_008.cpp(23): PARTIAL
//H 02:
//H 03: _
-//H 02: CAT(Token1, Token2)
-//H 00: t_1_008.cpp(18): CAT(Token1, Token2), [t_1_008.cpp(14): CAT(a, b)=a ## b]
+//H 02: CAT( Token1, Token2 )
+//H 00: t_1_008.cpp(18): CAT( Token1, Token2 ), [t_1_008.cpp(14): CAT(a, b)=a ## b]
//H 02: Token1Token2
//H 03: Token1Token2
//H 03: Token1Token2
@@ -96,8 +96,8 @@
//H 01: t_1_008.cpp(23): PARTIAL
//H 02:
//H 03: _
-//H 02: CAT(PARTIALPARTIAL X, Token2)
-//H 00: t_1_008.cpp(19): CAT(PARTIALPARTIAL X, Token2), [t_1_008.cpp(14): CAT(a, b)=a ## b]
+//H 02: CAT(PARTIALPARTIAL X, Token2 )
+//H 00: t_1_008.cpp(19): CAT(PARTIALPARTIAL X, Token2 ), [t_1_008.cpp(14): CAT(a, b)=a ## b]
//H 02: PARTIALPARTIAL XToken2
//H 01: t_1_008.cpp(24): PARTIALPARTIAL
//H 02:
@@ -117,8 +117,8 @@
//H 01: t_1_008.cpp(26): X
//H 02: Token1
//H 03: Token1
-//H 02: CAT(Token1, Y PARTIALPARTIAL)
-//H 00: t_1_008.cpp(20): CAT(Token1, Y PARTIALPARTIAL), [t_1_008.cpp(14): CAT(a, b)=a ## b]
+//H 02: CAT( Token1, Y PARTIALPARTIAL)
+//H 00: t_1_008.cpp(20): CAT( Token1, Y PARTIALPARTIAL), [t_1_008.cpp(14): CAT(a, b)=a ## b]
//H 02: Token1Y PARTIALPARTIAL
//H 01: t_1_008.cpp(24): PARTIALPARTIAL
//H 02:
Modified: branches/release/libs/wave/test/testwave/testfiles/t_1_013.cpp
==============================================================================
--- branches/release/libs/wave/test/testwave/testfiles/t_1_013.cpp (original)
+++ branches/release/libs/wave/test/testwave/testfiles/t_1_013.cpp 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -79,7 +79,7 @@
//H 01: t_1_013.cpp(21): LOW
//H 02: LOW ", world"
//H 03: LOW ", world"
-//H 02: glue(HIGH, LOW ", world")
+//H 02: glue(HIGH, LOW ", world")
//H 00: t_1_013.cpp(19): glue(HIGH, LOW ", world"), [t_1_013.cpp(18): glue(a, b)=a ## b]
//H 02: HIGHLOW ", world"
//H 01: t_1_013.cpp(20): HIGHLOW
Modified: branches/release/libs/wave/test/testwave/testfiles/t_1_030.cpp
==============================================================================
--- branches/release/libs/wave/test/testwave/testfiles/t_1_030.cpp (original)
+++ branches/release/libs/wave/test/testwave/testfiles/t_1_030.cpp 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -26,7 +26,7 @@
//H 00: t_1_030.cpp(17): EMPTY(), [t_1_030.cpp(12): EMPTY()=]
//H 02:
//H 03: _
-//H 02: MACRO
+//H 02: MACRO
//H 03: MACRO
//H 00: t_1_030.cpp(17): MACRO(1), [t_1_030.cpp(14): MACRO(x)=(x)]
//H 02: (1)
Modified: branches/release/libs/wave/test/testwave/testfiles/t_1_034.cpp
==============================================================================
--- branches/release/libs/wave/test/testwave/testfiles/t_1_034.cpp (original)
+++ branches/release/libs/wave/test/testwave/testfiles/t_1_034.cpp 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -17,7 +17,7 @@
//R #line 19 "t_1_034.cpp"
MACRO1(1,) //R 1 ->
-MACRO2(1, 2) //R 1,2
+MACRO2(1, 2) //R 1, 2
STR() //R ""
//H 10: t_1_034.cpp(14): #define
@@ -27,11 +27,11 @@
//H 10: t_1_034.cpp(16): #define
//H 08: t_1_034.cpp(16): STR(...)=#__VA_ARGS__
//H 00: t_1_034.cpp(19): MACRO1(1,§), [t_1_034.cpp(14): MACRO1(x, ...)=x -> __VA_ARGS__]
-//H 02: 1 -> §
+//H 02: 1 ->
//H 03: 1 ->
//H 00: t_1_034.cpp(20): MACRO2(1, 2), [t_1_034.cpp(15): MACRO2(...)=__VA_ARGS__]
-//H 02: 1,2
-//H 03: 1,2
+//H 02: 1, 2
+//H 03: 1, 2
//H 00: t_1_034.cpp(21): STR(§), [t_1_034.cpp(16): STR(...)=#__VA_ARGS__]
//H 02: ""
//H 03: ""
Modified: branches/release/libs/wave/test/testwave/testfiles/t_1_038.cpp
==============================================================================
--- branches/release/libs/wave/test/testwave/testfiles/t_1_038.cpp (original)
+++ branches/release/libs/wave/test/testwave/testfiles/t_1_038.cpp 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -33,5 +33,5 @@
//H 10: t_1_038.cpp(12): #define
//H 08: t_1_038.cpp(12): BAZ(T, E)=T E
//H 00: t_1_038.cpp(16): BAZ(bool, value = true ), [t_1_038.cpp(12): BAZ(T, E)=T E]
-//H 02: bool value = true
-//H 03: bool value = true
+//H 02: bool value = true
+//H 03: bool value = true
Modified: branches/release/libs/wave/test/testwave/testfiles/t_5_030.cpp
==============================================================================
--- branches/release/libs/wave/test/testwave/testfiles/t_5_030.cpp (original)
+++ branches/release/libs/wave/test/testwave/testfiles/t_5_030.cpp 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -39,7 +39,7 @@
#define FUNC3(a, b) FUNC2(a, b) + NEST3
#define FUNC2(a, b) FUNC1(a, b) + NEST2
#define FUNC1(a, b) (a) + (b)
-FUNC4(NEST1, NEST2) //R (1) + (1 + 2) + 1 + 2 + 1 + 2 + 3 + 1 + 2 + 3 + 4
+FUNC4(NEST1, NEST2) //R (1) + ( 1 + 2) + 1 + 2 + 1 + 2 + 3 + 1 + 2 + 3 + 4
// 27.3: An identifier generated by ## operator is subject to expansion.
//R #line 48 "t_5_030.cpp"
@@ -52,7 +52,7 @@
//R #line 55 "t_5_030.cpp"
#define SUB(x, y) (x - y)
#define MATH(op, a, b) op( (a), (b))
-MATH(SUB, a, b) //R ((a) - (b))
+MATH(SUB, a, b) //R ( ( a) - ( b))
// 27.5: Queer thing.
// R #line 28 "t_5_030.cpp"
Modified: branches/release/libs/wave/test/testwave/testfiles/t_9_010.cpp
==============================================================================
--- branches/release/libs/wave/test/testwave/testfiles/t_9_010.cpp (original)
+++ branches/release/libs/wave/test/testwave/testfiles/t_9_010.cpp 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -54,7 +54,7 @@
//H 00: t_9_010.cpp(28): X(), [t_9_010.cpp(24): X()=B]
//H 02: B
//H 03: B
-//H 02: PRIMITIVE_CAT(A, B C)
+//H 02: PRIMITIVE_CAT(A, B C)
//H 00: t_9_010.cpp(21): PRIMITIVE_CAT(A, B C), [t_9_010.cpp(22): PRIMITIVE_CAT(a, b)=a ## b]
//H 02: AB C
//H 03: AB C
@@ -63,7 +63,7 @@
//H 00: t_9_010.cpp(29): X(), [t_9_010.cpp(24): X()=B]
//H 02: B
//H 03: B
-//H 02: PRIMITIVE_CAT(A, BC)
+//H 02: PRIMITIVE_CAT(A, BC)
//H 00: t_9_010.cpp(21): PRIMITIVE_CAT(A, BC), [t_9_010.cpp(22): PRIMITIVE_CAT(a, b)=a ## b]
//H 02: ABC
//H 03: ABC
Modified: branches/release/libs/wave/test/testwave/testfiles/t_9_012.cpp
==============================================================================
--- branches/release/libs/wave/test/testwave/testfiles/t_9_012.cpp (original)
+++ branches/release/libs/wave/test/testwave/testfiles/t_9_012.cpp 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -16,10 +16,10 @@
nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)
//R #line 19 "t_9_012.cpp"
-CreateWindowA(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) //R CreateWindowExA(0L, 1, 2, 3, 4, 5,6, 7, 8, 9, 10, 11)
+CreateWindowA(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) //R CreateWindowExA(0L, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
//H 10: t_9_012.cpp(13): #define
//H 08: t_9_012.cpp(13): CreateWindowA(lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)=CreateWindowExA(0L, lpClassName, lpWindowName, dwStyle, x, y,nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)
//H 00: t_9_012.cpp(19): CreateWindowA(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11), [t_9_012.cpp(13): CreateWindowA(lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)=CreateWindowExA(0L, lpClassName, lpWindowName, dwStyle, x, y,nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)]
-//H 02: CreateWindowExA(0L, 1, 2, 3, 4, 5,6, 7, 8, 9, 10, 11)
-//H 03: CreateWindowExA(0L, 1, 2, 3, 4, 5,6, 7, 8, 9, 10, 11)
+//H 02: CreateWindowExA(0L, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
+//H 03: CreateWindowExA(0L, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
Modified: branches/release/libs/wave/test/testwave/testfiles/test.cfg
==============================================================================
--- branches/release/libs/wave/test/testwave/testfiles/test.cfg (original)
+++ branches/release/libs/wave/test/testwave/testfiles/test.cfg 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -234,3 +234,4 @@
t_9_017.cpp
t_9_018.cpp
t_9_019.cpp
+t_9_020.cpp
Modified: branches/release/tools/wave/trace_macro_expansion.hpp
==============================================================================
--- branches/release/tools/wave/trace_macro_expansion.hpp (original)
+++ branches/release/tools/wave/trace_macro_expansion.hpp 2011-04-17 17:58:25 EDT (Sun, 17 Apr 2011)
@@ -1144,10 +1144,71 @@
}
///////////////////////////////////////////////////////////////////////////
+ // join all adjacent string tokens into the first one
+ template <typename StringT>
+ StringT unlit(StringT const& str)
+ {
+ return str.substr(1, str.size()-2);
+ }
+
+ template <typename StringT>
+ StringT merge_string_lits(StringT const& lhs, StringT const& rhs)
+ {
+ StringT result ("\"");
+
+ result += unlit(lhs);
+ result += unlit(rhs);
+ result += "\"";
+ return result;
+ }
+
+ template <typename ContextT, typename ContainerT>
+ void join_adjacent_string_tokens(ContextT &ctx, ContainerT const& values,
+ ContainerT& joined_values)
+ {
+ using namespace boost::wave;
+
+ typedef typename ContextT::token_type token_type;
+ typedef typename token_type::string_type string_type;
+ typedef typename ContainerT::const_iterator const_iterator;
+ typedef typename ContainerT::iterator iterator;
+
+ token_type* current = 0;
+
+ const_iterator end = values.end();
+ for (const_iterator it = values.begin(); it != end; ++it) {
+ token_id id(*it);
+
+ if (id == T_STRINGLIT) {
+ if (!current) {
+ joined_values.push_back(*it);
+ current = &joined_values.back();
+ }
+ else {
+ current->set_value(merge_string_lits(
+ current->get_value(), (*it).get_value()));
+ }
+ }
+ else if (current) {
+ typedef util::impl::next_token<const_iterator> next_token_type;
+ token_id next_id (next_token_type::peek(it, end, true));
+
+ if (next_id != T_STRINGLIT) {
+ current = 0;
+ joined_values.push_back(*it);
+ }
+ }
+ else {
+ joined_values.push_back(*it);
+ }
+ }
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
// interpret the pragma wave option() directives
template <typename ContextT, typename ContainerT>
bool
- interpret_pragma_option(ContextT &ctx, ContainerT const &values,
+ interpret_pragma_option(ContextT &ctx, ContainerT const &cvalues,
typename ContextT::token_type const &act_token)
{
using namespace boost::wave;
@@ -1156,6 +1217,9 @@
typedef typename token_type::string_type string_type;
typedef typename ContainerT::const_iterator const_iterator;
+ ContainerT values;
+ join_adjacent_string_tokens(ctx, cvalues, values);
+
const_iterator end = values.end();
for (const_iterator it = values.begin(); it != end; /**/) {
bool valid_option = false;
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