Update of /cvsroot/boost/boost/tools/quickbook
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4645
Modified Files:
block.hpp phrase.hpp
Added Files:
preprocessor.hpp
Log Message:
Better comments
--- NEW FILE: preprocessor.hpp ---
/*=============================================================================
Copyright (c) 2002-2006 Joel de Guzman
http://spirit.sourceforge.net/
Use, modification and distribution is subject to 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)
=============================================================================*/
#if !defined(BOOST_SPIRIT_QUICKBOOK_PREPROCESSOR_HPP)
#define BOOST_SPIRIT_QUICKBOOK_PREPROCESSOR_HPP
//~ #include "detail/utils.hpp"
#include <boost/spirit/core.hpp>
//~ #include <boost/spirit/utility/confix.hpp>
//~ #include <boost/spirit/utility/chset.hpp>
//~ #include <boost/spirit/actor/assign_actor.hpp>
//~ #include <boost/spirit/dynamic/if.hpp>
namespace quickbook
{
using namespace boost::spirit;
template <typename Rule, typename Action>
inline void
simple_markup(Rule& simple, char mark, Action const& action, Rule const&
eol)
{
simple =
mark >>
(
(
graph_p // A single char. e.g. *c*
>> eps_p(mark
>> (space_p | punct_p | end_p))
// space_p, punct_p or end_p
) // must follow mark
|
( graph_p >> // graph_p must follow mark
*(anychar_p -
( (eol >> eol) // Make sure that we don't go
| (graph_p >> mark) // past a single block
)
)
>> (graph_p - '\\') // graph_p (but not the
back-slash)
// must precede mark
>> eps_p(mark
>> (space_p | punct_p | end_p))
// space_p, punct_p or end_p
) // must follow mark
) [action]
>> mark
;
}
template <typename Actions>
struct preprocessor : grammar<preprocessor<Actions> >
{
preprocessor(Actions& actions)
: actions(actions) {}
template <typename Scanner>
struct definition
{
definition(preprocessor const& self)
{
Actions& actions = self.actions;
start_ = +anychar_p[actions.];
}
rule<Scanner> start_;
rule<Scanner> const&
start() const { return start_; }
};
Actions& actions;
};
}
#endif // BOOST_SPIRIT_QUICKBOOK_PREPROCESSOR_HPP
Index: block.hpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/quickbook/block.hpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- block.hpp 7 Jun 2006 04:20:13 -0000 1.15
+++ block.hpp 16 Nov 2006 05:19:08 -0000 1.16
@@ -87,7 +87,12 @@
; // alpha-numeric or
underscore
comment =
- "[/" >> *(anychar_p - ']') >> ']'
+ "[//" >> *(anychar_p - eol_p) >> eol_p
+ | "[/" >> *(dummy_block | (anychar_p - ']')) >> ']'
+ ;
+
+ dummy_block =
+ '[' >> *(dummy_block | (anychar_p - ']')) >> ']'
;
hr =
@@ -398,7 +403,7 @@
preformatted, list_item, begin_section,
end_section,
xinclude, include, hard_space, eol, paragraph_end,
template_, template_id, template_formal_arg,
- template_body, identifier;
+ template_body, identifier, dummy_block;
symbols<> paragraph_end_markups;
Index: phrase.hpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/quickbook/phrase.hpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- phrase.hpp 16 Nov 2006 04:15:20 -0000 1.18
+++ phrase.hpp 16 Nov 2006 05:19:08 -0000 1.19
@@ -88,7 +88,12 @@
; // alpha-numeric or
underscore
comment =
- "[/" >> *(anychar_p - ']') >> ']'
+ "[//" >> *(anychar_p - eol_p) >> eol_p
+ | "[/" >> *(dummy_block | (anychar_p - ']')) >> ']'
+ ;
+
+ dummy_block =
+ '[' >> *(dummy_block | (anychar_p - ']')) >> ']'
;
common =
@@ -373,7 +378,7 @@
simple_bold, simple_italic, simple_underline,
simple_teletype, source_mode, template_,
template_arg,
quote, code_block, footnote, replaceable, macro,
- brackets, template_args;
+ brackets, template_args, dummy_block;
rule<Scanner> const&
start() const { return common; }
@@ -406,12 +411,17 @@
;
comment =
- "[/" >> *(anychar_p - ']') >> ']'
+ "[//" >> *(anychar_p - eol_p) >> eol_p
+ | "[/" >> *(dummy_block | (anychar_p - ']')) >> ']'
+ ;
+
+ dummy_block =
+ '[' >> *(dummy_block | (anychar_p - ']')) >> ']'
;
}
bool unused;
- rule<Scanner> phrase, comment;
+ rule<Scanner> phrase, comment, dummy_block;
phrase_grammar<Actions> common;
rule<Scanner> const&
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs