From ad8a25c78c1a6be7c2c940b95a460bb783dc4d5d Mon Sep 17 00:00:00 2001 From: dellaert Date: Sun, 30 Nov 2014 11:24:12 +0100 Subject: [PATCH] A bit of namespace shielding for use in header --- wrap/tests/testType.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/wrap/tests/testType.cpp b/wrap/tests/testType.cpp index 00b6f2f58..7b3c8665d 100644 --- a/wrap/tests/testType.cpp +++ b/wrap/tests/testType.cpp @@ -27,13 +27,13 @@ using namespace std; using namespace wrap; -using namespace BOOST_SPIRIT_CLASSIC_NS; +namespace classic = BOOST_SPIRIT_CLASSIC_NS; -typedef rule Rule; +typedef classic::rule Rule; //****************************************************************************** // http://boost-spirit.com/distrib/spirit_1_8_2/libs/spirit/doc/grammar.html -struct type_grammar: public grammar { +struct type_grammar: public classic::grammar { Qualified& result_; ///< successful parse will be placed in here @@ -46,13 +46,23 @@ struct type_grammar: public grammar { template struct definition { - typedef rule Rule; + typedef classic::rule Rule; Rule void_p, basisType_p, eigenType_p, keywords_p, stlType_p, className_p, namepsace_p, namespace_del_p, class_p, type_p; definition(type_grammar const& self) { + using classic::lexeme_d; + using classic::eps_p; + using classic::str_p; + using classic::upper_p; + using classic::lower_p; + using classic::alnum_p; + using classic::assign_a; + using classic::push_back_a; + using classic::clear_a; + void_p = str_p("void")[assign_a(self.result_.name)]; basisType_p = (str_p("string") | "bool" | "size_t" | "int" | "double" @@ -88,6 +98,9 @@ struct type_grammar: public grammar { //****************************************************************************** TEST( spirit, grammar ) { + + using classic::space_p; + // Create grammar that will place result in actual Qualified actual; type_grammar type_g(actual);