[DEV] add v1.66.0

This commit is contained in:
2018-01-12 21:47:58 +01:00
parent 87059bb1af
commit a97e9ae7d4
49032 changed files with 7668950 additions and 0 deletions

View File

@@ -0,0 +1 @@
exe parsing_error : main.cpp ;

View File

@@ -0,0 +1,17 @@
This example shows how a compile-time parsing error can be debugged.
The commented code fails to compile and on some platforms the error report might
be difficult to understand. This example demonstrates how debug_parsing_error
can be used to get a user friendly error report about such thing. You need to
run the compiled code to get the error message:
Compile-time parsing results
----------------------------
Input text:
aaac
Parsing failed:
line 1, col 4: Expected: b
The col and line information refers to the location of the error in the string
literal.

View File

@@ -0,0 +1,51 @@
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2011.
// 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)
#include <boost/metaparse/repeated.hpp>
#include <boost/metaparse/sequence.hpp>
#include <boost/metaparse/lit_c.hpp>
#include <boost/metaparse/debug_parsing_error.hpp>
#include <boost/metaparse/build_parser.hpp>
#include <boost/metaparse/string.hpp>
#include <boost/mpl/apply.hpp>
using boost::metaparse::sequence;
using boost::metaparse::lit_c;
using boost::metaparse::repeated;
using boost::metaparse::build_parser;
using boost::metaparse::debug_parsing_error;
using boost::mpl::apply;
/*
* The grammar
*
* s ::= a*b
*/
typedef sequence<repeated<lit_c<'a'> >, lit_c<'b'> > s;
typedef build_parser<s> test_parser;
#if BOOST_METAPARSE_STD < 2011
typedef boost::metaparse::string<'a','a','a','c'> invalid_input;
#else
typedef BOOST_METAPARSE_STRING("aaac") invalid_input;
#endif
debug_parsing_error<test_parser, invalid_input> debug;
int main()
{
// This causes an error
// apply<test_parser, invalid_input>::type();
}