Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75699 - in trunk/tools/quickbook: src test
From: dnljms_at_[hidden]
Date: 2011-11-27 17:45:56


Author: danieljames
Date: 2011-11-27 17:45:55 EST (Sun, 27 Nov 2011)
New Revision: 75699
URL: http://svn.boost.org/trac/boost/changeset/75699

Log:
Quickbook: Fix error with empty macro defines.
Text files modified:
   trunk/tools/quickbook/src/actions.cpp | 4 +++-
   trunk/tools/quickbook/test/Jamfile.v2 | 3 ++-
   trunk/tools/quickbook/test/command_line_macro-1_1.gold | 3 +++
   trunk/tools/quickbook/test/command_line_macro-1_1.quickbook | 6 +++++-
   4 files changed, 13 insertions(+), 3 deletions(-)

Modified: trunk/tools/quickbook/src/actions.cpp
==============================================================================
--- trunk/tools/quickbook/src/actions.cpp (original)
+++ trunk/tools/quickbook/src/actions.cpp 2011-11-27 17:45:55 EST (Sun, 27 Nov 2011)
@@ -865,7 +865,9 @@
     {
         value_consumer values = macro_definition;
         std::string macro_id = values.consume().get_quickbook();
- std::string phrase = values.consume().get_encoded();
+ value phrase_value = values.optional_consume();
+ std::string phrase;
+ if (phrase_value.check()) phrase = phrase_value.get_encoded();
         values.finish();
 
         std::string* existing_macro =

Modified: trunk/tools/quickbook/test/Jamfile.v2
==============================================================================
--- trunk/tools/quickbook/test/Jamfile.v2 (original)
+++ trunk/tools/quickbook/test/Jamfile.v2 2011-11-27 17:45:55 EST (Sun, 27 Nov 2011)
@@ -34,7 +34,8 @@
     [ quickbook-test code_snippet-1_1 ]
     [ quickbook-test code_teletype-1_5 ]
     [ quickbook-test command_line_macro-1_1 : : :
- <quickbook-test-define>__macro__=*bold* ]
+ <quickbook-test-define>__macro__=*bold*
+ <quickbook-test-define>__empty__ ]
     [ quickbook-error-test command_line_macro-1_1-invalid :
         command_line_macro-1_1.quickbook :
         <testing.arg>'-Dsomething[]' ]

Modified: trunk/tools/quickbook/test/command_line_macro-1_1.gold
==============================================================================
--- trunk/tools/quickbook/test/command_line_macro-1_1.gold (original)
+++ trunk/tools/quickbook/test/command_line_macro-1_1.gold 2011-11-27 17:45:55 EST (Sun, 27 Nov 2011)
@@ -6,4 +6,7 @@
   <para>
     <emphasis role="bold">bold</emphasis>
   </para>
+ <para>
+ empty is defined
+ </para>
 </article>

Modified: trunk/tools/quickbook/test/command_line_macro-1_1.quickbook
==============================================================================
--- trunk/tools/quickbook/test/command_line_macro-1_1.quickbook (original)
+++ trunk/tools/quickbook/test/command_line_macro-1_1.quickbook 2011-11-27 17:45:55 EST (Sun, 27 Nov 2011)
@@ -3,4 +3,8 @@
 
 [/ This test relies on __macro__ being defined at the command line.]
 
-__macro__
\ No newline at end of file
+__macro__
+
+__empty__
+
+[?__empty__ empty is defined]
\ No newline at end of file


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