]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*============================================================================= |
2 | Copyright (c) 2001-2011 Joel de Guzman | |
3 | ||
4 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
5 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 | =============================================================================*/ | |
7 | #if !defined(BOOST_SPIRIT_WHAT_APRIL_21_2007_0732AM) | |
8 | #define BOOST_SPIRIT_WHAT_APRIL_21_2007_0732AM | |
9 | ||
10 | #if defined(_MSC_VER) | |
11 | #pragma once | |
12 | #endif | |
13 | ||
14 | #include <boost/mpl/assert.hpp> | |
15 | #include <boost/spirit/home/support/info.hpp> | |
16 | #include <boost/spirit/home/qi/meta_compiler.hpp> | |
17 | ||
18 | namespace boost { namespace spirit { namespace qi | |
19 | { | |
20 | template <typename Expr> | |
21 | inline info what(Expr const& expr) | |
22 | { | |
23 | // Report invalid expression error as early as possible. | |
24 | // If you got an error_expr_is_not_convertible_to_a_parser | |
25 | // error message here, then the expression (expr) is not a | |
26 | // valid spirit qi expression. | |
27 | BOOST_SPIRIT_ASSERT_MATCH(qi::domain, Expr); | |
28 | return compile<qi::domain>(expr).what(unused); | |
29 | } | |
30 | }}} | |
31 | ||
32 | #endif | |
33 |