[Boost-bugs] [Boost C++ Libraries] #1914: Boost.PropertyTree JSON parser in SVN trunk does not compile with Spirit2 changes

Subject: [Boost-bugs] [Boost C++ Libraries] #1914: Boost.PropertyTree JSON parser in SVN trunk does not compile with Spirit2 changes
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-05-13 07:29:40


#1914: Boost.PropertyTree JSON parser in SVN trunk does not compile with Spirit2
changes
--------------------------------------------------------+-------------------
 Reporter: ramon.casellas_at_[hidden] | Owner: kaalus
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: property_tree
  Version: Boost Development Trunk | Severity: Showstopper
 Keywords: property tree, Boost.PropertyTree, spirit2 |
--------------------------------------------------------+-------------------
 Boost.PropertyTree JSON parser in SVN trunk does not compile with Spirit2
 changes.

 See g++ 4.1 log.

 Attached patch that solves the issue (at least for me). A hack, surely
 there exists a better/cleaner patch

 (compile)

 from .... boost/property_tree/detail/json_parser_read.hpp
 from .... boost/property_tree/json_parser.hpp
 from .... proj/parser.cpp
 /mnt/server/grups/boost/include/boost-1_35/boost/spirit.hpp:15:4: warning:
 #warning "This header is deprecated. Please use:
 boost/spirit/include/classic.hpp"
 /mnt/server/grups/boost/include/boost-
 1_35/boost/property_tree/detail/json_parser_read.hpp:158: error: expected
 template-name before < token
 compilation terminated due to -Wfatal-errors

 (patch)
 -----8<-------8<-------
 --- /opt/boost-svn/include/boost-
 1_35/boost/property_tree/detail/json_parser_read.hpp.old 2008-05-13
 08:56:17.000000000 +0200
 +++ /opt/boost-svn/include/boost-
 1_35/boost/property_tree/detail/json_parser_read.hpp 2008-05-13
 09:04:10.000000000 +0200
 @@ -15,7 +15,7 @@
  #include <boost/property_tree/ptree.hpp>
  #include <boost/property_tree/detail/ptree_utils.hpp>
  #include <boost/property_tree/detail/json_parser_error.hpp>
 -#include <boost/spirit.hpp>
 +#include <boost/spirit/include/classic.hpp>
  #include <string>
  #include <locale>
  #include <istream>
 @@ -24,6 +24,7 @@

  namespace boost { namespace property_tree { namespace json_parser
  {
 + using namespace BOOST_SPIRIT_CLASSIC_NS;

 ///////////////////////////////////////////////////////////////////////
      // Json parser context
 @@ -155,7 +156,7 @@
      // Json grammar

      template<class Ptree>
 - struct json_grammar: public
 boost::spirit::grammar<json_grammar<Ptree> >
 + struct json_grammar: public grammar<json_grammar<Ptree> >
      {

          typedef context<Ptree> Context;
 @@ -167,14 +168,11 @@
          struct definition
          {

 - boost::spirit::rule<Scanner> root, object, member, array,
 item, value, string, number;
 - boost::spirit::rule<typename
 boost::spirit::lexeme_scanner<Scanner>::type> character, escape;
 + rule<Scanner> root, object, member, array, item, value,
 string, number;
 + rule<typename lexeme_scanner<Scanner>::type> character,
 escape;

              definition(const json_grammar &self)
              {
 -
 - using namespace boost::spirit;
 -
                  // Assertions
                  assertion<std::string> expect_object("expected object");
                  assertion<std::string> expect_eoi("expected end of
 input");
 @@ -259,7 +257,7 @@

              }

 - const boost::spirit::rule<Scanner> &start() const
 + const rule<Scanner> &start() const
              {
                  return root;
              }
 @@ -279,8 +277,6 @@
                              Ptree &pt,
                              const std::string &filename)
      {
 -
 - using namespace boost::spirit;
          typedef typename Ptree::key_type::value_type Ch;
          typedef typename std::vector<Ch>::iterator It;
  -----------------------8<-------------------------------------------

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1914>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.


This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:57 UTC