]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/spirit/test/x3/rule_separate_tu_grammar.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / spirit / test / x3 / rule_separate_tu_grammar.hpp
CommitLineData
92f5a8d4
TL
1/*=============================================================================
2 Copyright (c) 2019 Nikita Kniazev
3
4 Use, modification and distribution is subject to the Boost Software
5 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 http://www.boost.org/LICENSE_1_0.txt)
7=============================================================================*/
8
9#include <boost/spirit/home/x3.hpp>
10
11// Check that `BOOST_SPIRIT_INSTANTIATE` instantiates `parse_rule` with proper
12// types when a rule has no attribute.
13
14namespace unused_attr {
15
16namespace x3 = boost::spirit::x3;
17
18// skipper must has no attribute, checks `parse` and `skip_over`
19using skipper_type = x3::rule<class skipper_r>;
20const skipper_type skipper;
21BOOST_SPIRIT_DECLARE(skipper_type)
22
23// the `unused_type const` must have the same effect as no attribute
24using skipper2_type = x3::rule<class skipper2_r, x3::unused_type const>;
25const skipper2_type skipper2;
26BOOST_SPIRIT_DECLARE(skipper2_type)
27
28// grammar must has no attribute, checks `parse` and `phrase_parse`
29using grammar_type = x3::rule<class grammar_r>;
30const grammar_type grammar;
31BOOST_SPIRIT_DECLARE(grammar_type)
32
33}
34
35// Check instantiation when rule has an attribute.
36
37namespace used_attr {
38
39namespace x3 = boost::spirit::x3;
40
41using skipper_type = x3::rule<class skipper_r>;
42const skipper_type skipper;
43BOOST_SPIRIT_DECLARE(skipper_type)
44
1e59de90 45using grammar_type = x3::rule<class grammar_r, int, true>;
92f5a8d4
TL
46const grammar_type grammar;
47BOOST_SPIRIT_DECLARE(grammar_type)
48
49}