Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72392 - trunk/tools/quickbook/src
From: dnljms_at_[hidden]
Date: 2011-06-04 12:17:52


Author: danieljames
Date: 2011-06-04 12:17:51 EDT (Sat, 04 Jun 2011)
New Revision: 72392
URL: http://svn.boost.org/trac/boost/changeset/72392

Log:
Quickbook: Match macros in simple markup in the grammar.
Text files modified:
   trunk/tools/quickbook/src/actions.cpp | 9 +--------
   trunk/tools/quickbook/src/actions.hpp | 3 ---
   trunk/tools/quickbook/src/actions_class.cpp | 2 +-
   trunk/tools/quickbook/src/main_grammar.cpp | 17 +++++++++--------
   4 files changed, 11 insertions(+), 20 deletions(-)

Modified: trunk/tools/quickbook/src/actions.cpp
==============================================================================
--- trunk/tools/quickbook/src/actions.cpp (original)
+++ trunk/tools/quickbook/src/actions.cpp 2011-06-04 12:17:51 EDT (Sat, 04 Jun 2011)
@@ -380,14 +380,7 @@
         values.finish();
 
         out << markup.pre;
- if (std::string const* ptr = find(macro, content.get_quickbook().c_str()))
- {
- out << *ptr;
- }
- else
- {
- out << content.get_boostbook();
- }
+ out << content.get_boostbook();
         out << markup.post;
     }
 

Modified: trunk/tools/quickbook/src/actions.hpp
==============================================================================
--- trunk/tools/quickbook/src/actions.hpp (original)
+++ trunk/tools/quickbook/src/actions.hpp 2011-06-04 12:17:51 EDT (Sat, 04 Jun 2011)
@@ -124,16 +124,13 @@
 
         simple_phrase_action(
             collector& out
- , string_symbols const& macro
           , quickbook::actions& actions)
         : out(out)
- , macro(macro)
         , actions(actions) {}
 
         void operator()(char) const;
 
         collector& out;
- string_symbols const& macro;
         quickbook::actions& actions;
     };
 

Modified: trunk/tools/quickbook/src/actions_class.cpp
==============================================================================
--- trunk/tools/quickbook/src/actions_class.cpp (original)
+++ trunk/tools/quickbook/src/actions_class.cpp 2011-06-04 12:17:51 EDT (Sat, 04 Jun 2011)
@@ -75,7 +75,7 @@
         , raw_char(phrase, *this)
         , escape_unicode(phrase, *this)
 
- , simple_markup(phrase, macro, *this)
+ , simple_markup(phrase, *this)
 
         , break_(phrase, *this)
         , do_macro(phrase, *this)

Modified: trunk/tools/quickbook/src/main_grammar.cpp
==============================================================================
--- trunk/tools/quickbook/src/main_grammar.cpp (original)
+++ trunk/tools/quickbook/src/main_grammar.cpp 2011-06-04 12:17:51 EDT (Sat, 04 Jun 2011)
@@ -368,10 +368,10 @@
             ;
 
         local.simple_markup =
- cl::chset<>("*/_=") [local.simple_markup.mark = ph::arg1]
- >> cl::eps_p(cl::graph_p) // graph_p must follow first mark
+ cl::chset<>("*/_=") [local.simple_markup.mark = ph::arg1]
+ >> cl::eps_p(cl::graph_p) // graph_p must follow first mark
>> lookback
- [ cl::anychar_p
+ [ cl::anychar_p // skip back over the markup
>> ~cl::eps_p(cl::f_ch_p(local.simple_markup.mark))
                                                 // first mark not be preceeded by
                                                 // the same character.
@@ -384,11 +384,12 @@
                 [
                     actions.scoped_output()
                     [
- (+( ~cl::eps_p(local.simple_markup_end)
- >> local.nested_char
- )) [actions.docinfo_value(ph::arg1, ph::arg2)]
- ]
- >> cl::f_ch_p(local.simple_markup.mark)
+ ( cl::eps_p(actions.macro >> local.simple_markup_end)
+ >> actions.macro [actions.do_macro]
+ | +(~cl::eps_p(local.simple_markup_end) >> local.nested_char)
+ ) [actions.docinfo_value(ph::arg1, ph::arg2)]
+ ]
+ >> cl::f_ch_p(local.simple_markup.mark)
                                                 [actions.simple_markup]
                 ]
             ;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk