]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/tools/quickbook/src/syntax_highlight.hpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / tools / quickbook / src / syntax_highlight.hpp
CommitLineData
7c673cae
FG
1/*=============================================================================
2 Copyright (c) 2011,2013 Daniel James
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#if !defined(BOOST_QUICKBOOK_SYNTAX_HIGHLIGHT_HPP)
10#define BOOST_QUICKBOOK_SYNTAX_HIGHLIGHT_HPP
11
11fdf7f2 12#include <boost/swap.hpp>
7c673cae 13#include "fwd.hpp"
b32b8144 14#include "iterator.hpp"
11fdf7f2 15#include "phrase_tags.hpp"
7c673cae
FG
16
17namespace quickbook
18{
19 //
20 // source_mode_info
21 //
22 // The source mode is stored in a few places, so the order needs to also be
23 // stored to work out which is the current source mode.
24
11fdf7f2
TL
25 struct source_mode_info
26 {
7c673cae
FG
27 source_mode_type source_mode;
28 unsigned order;
29
30 source_mode_info() : source_mode(source_mode_tags::cpp), order(0) {}
31
11fdf7f2
TL
32 source_mode_info(source_mode_type source_mode_, unsigned order_)
33 : source_mode(source_mode_), order(order_)
34 {
35 }
7c673cae 36
11fdf7f2
TL
37 void update(source_mode_info const& x)
38 {
7c673cae
FG
39 if (x.order > order) {
40 source_mode = x.source_mode;
41 order = x.order;
42 }
43 }
44
11fdf7f2
TL
45 void swap(source_mode_info& x)
46 {
7c673cae
FG
47 boost::swap(source_mode, x.source_mode);
48 boost::swap(order, x.order);
49 }
50 };
51
11fdf7f2 52 inline void swap(source_mode_info& x, source_mode_info& y) { x.swap(y); }
7c673cae
FG
53
54 void syntax_highlight(
11fdf7f2
TL
55 parse_iterator first,
56 parse_iterator last,
7c673cae
FG
57 quickbook::state& state,
58 source_mode_type source_mode,
59 bool is_block);
60}
61
62#endif