From cc34500587d6af342202a58f73dd64def952bb3a Mon Sep 17 00:00:00 2001 From: Daniel James Date: Wed, 30 Nov 2011 01:35:25 +0000 Subject: [PATCH] Quickbook: Merge from trunk to quickbook-dev [SVN r75739] --- doc/quickbook.qbk | 8 +-- src/actions.cpp | 10 +++- src/code_snippet.cpp | 8 ++- src/main_grammar.cpp | 4 +- src/quickbook.cpp | 2 +- test/Jamfile.v2 | 5 +- test/callouts-1_5.gold | 36 ++++++++----- test/code-1_1.gold | 9 ++-- test/command_line_macro-1_1.gold | 3 ++ test/command_line_macro-1_1.quickbook | 6 ++- test/image-1_5.gold | 37 ++++++++++--- test/include/code-import.gold | 12 +++-- test/include/code-include.gold | 3 +- test/list_test-1_5.quickbook | 4 +- test/list_test-1_6.quickbook | 4 +- test/quickbook_manual-1_4.gold | 60 ++++++++++++++++------ test/snippets/pass_thru.gold | 9 ++-- test/snippets/unbalanced_snippet1-1_5.gold | 3 +- test/svg-1_1.gold | 13 +++-- 19 files changed, 169 insertions(+), 67 deletions(-) diff --git a/doc/quickbook.qbk b/doc/quickbook.qbk index 600c9ee..f061711 100644 --- a/doc/quickbook.qbk +++ b/doc/quickbook.qbk @@ -262,7 +262,7 @@ Boost 1.46.0: * Allow import, include and xinclude in conditional phrases. Will allow more block elements in a future version. * Rearrange the structure of the grammar. -* Use filesystem 3. Remove cygwin support. +* Use filesystem 3. Remove cygwin 1.5 support. Boost 1.46.1: @@ -2241,7 +2241,7 @@ adjust them to match your system in case you are running an older version. your home directory (`%HOMEDRIVE%%HOMEPATH%`). You must already have it somewhere or otherwise you could not be building Boost (i.e. missing tools configuration). - + ``` using xsltproc : "C:/Users/example/Documents/boost/xml/bin/xsltproc.exe" ; @@ -2250,6 +2250,7 @@ adjust them to match your system in case you are running an older version. : "C:/Users/example/Documents/boost/xml/docbook-xsl" : "C:/Users/example/Documents/boost/xml/docbook-xml" ; + ``` The above steps are enough to get a functional BoostBook setup. Quickbook will be automatically built when needed. If you want to avoid these @@ -2319,10 +2320,11 @@ rebuilds: # Add the following to your `user-config.jam` file, using the full path of the quickbook executable: - + ``` using quickbook : /usr/local/bin/quickbook ; + ``` [endsect] [/Linux] diff --git a/src/actions.cpp b/src/actions.cpp index 0e87ddb..dcbe1b5 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -767,7 +767,11 @@ namespace quickbook // Extract the alt tag, to use as a text description. // Or if there isn't one, use the stem of the file name. - quickbook::value alt_text = attributes["alt"]; + attribute_map::iterator alt_pos = attributes.find("alt"); + quickbook::value alt_text = + alt_pos != attributes.end() ? alt_pos->second : + qbk_version_n < 106u ? encoded_value(stem) : + quickbook::value(); attributes.erase("alt"); if(extension == "svg") @@ -865,7 +869,9 @@ namespace quickbook { 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 = diff --git a/src/code_snippet.cpp b/src/code_snippet.cpp index 4f65fa4..8d9484c 100644 --- a/src/code_snippet.cpp +++ b/src/code_snippet.cpp @@ -528,13 +528,17 @@ namespace quickbook while (snippet_stack) { if (qbk_version_n >= 106u) { detail::outerr(source_file->path) - << "Unclosed snippet '" << snippet_stack->id << "'" + << "Unclosed snippet '" + << detail::utf8(snippet_stack->id) + << "'" << std::endl; ++error_count; } else { detail::outwarn(source_file->path) - << "Unclosed snippet '" << snippet_stack->id << "'" + << "Unclosed snippet '" + << detail::utf8(snippet_stack->id) + << "'" << std::endl; } diff --git a/src/main_grammar.cpp b/src/main_grammar.cpp index 144d22d..f3d2552 100644 --- a/src/main_grammar.cpp +++ b/src/main_grammar.cpp @@ -351,7 +351,7 @@ namespace quickbook local.list = *cl::blank_p >> (cl::ch_p('*') | '#') - >> *cl::blank_p [local.list.still_in_block = true] + >> (*cl::blank_p) [local.list.still_in_block = true] >> *( cl::eps_p(local.list.still_in_block) >> local.list_item(element_info::only_block) ) @@ -560,6 +560,7 @@ namespace quickbook "```" >> *(*cl::blank_p >> cl::eol_p) >> ( *(cl::anychar_p - (*cl::space_p >> "```")) + >> !(*cl::blank_p >> cl::eol_p) >> cl::eps_p(*cl::space_p >> "```") ) [actions.code_block] >> *cl::space_p >> "```" @@ -568,6 +569,7 @@ namespace quickbook "``" >> *(*cl::blank_p >> cl::eol_p) >> ( *(cl::anychar_p - (*cl::space_p >> "``")) + >> !(*cl::blank_p >> cl::eol_p) >> cl::eps_p(*cl::space_p >> "``") ) [actions.code_block] >> *cl::space_p >> "``" diff --git a/src/quickbook.cpp b/src/quickbook.cpp index 329cd87..f762779 100644 --- a/src/quickbook.cpp +++ b/src/quickbook.cpp @@ -68,7 +68,7 @@ namespace quickbook if (!info.full) { detail::outerr() << "Error parsing command line definition: '" - << *it + << detail::utf8(*it) << "'" << std::endl; ++actor.error_count; diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 2df5e83..ed01fa3 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -34,10 +34,11 @@ test-suite quickbook.test : [ quickbook-test code_snippet-1_1 ] [ quickbook-test code_teletype-1_5 ] [ quickbook-test command_line_macro-1_1 : : : - __macro__=*bold* ] + __macro__=*bold* + __empty__ ] [ quickbook-error-test command_line_macro-1_1-invalid : command_line_macro-1_1.quickbook : - '-Dsomething[]' ] + -Dsomething[] ] [ quickbook-test cond_phrase-1_5 ] [ quickbook-test elements-1_5 ] [ quickbook-test elements-1_6 ] diff --git a/test/callouts-1_5.gold b/test/callouts-1_5.gold index 329b445..5b66c99 100644 --- a/test/callouts-1_5.gold +++ b/test/callouts-1_5.gold @@ -12,7 +12,8 @@ int roll_die() { boost::uniform_int<> dist(1, 6); -} +} + @@ -27,7 +28,8 @@ int roll_die() { boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); -} +} + @@ -44,7 +46,8 @@ int roll_die() { boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); -} +} + @@ -61,7 +64,8 @@ int roll_die() { boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); -} +} + @@ -79,7 +83,8 @@ int roll_die() { boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); boost::uniform_int<> dist(1, 6); -} +} + @@ -99,7 +104,8 @@ -boost::uniform_int<> dist(1, 6); +boost::uniform_int<> dist(1, 6); + @@ -124,7 +130,8 @@ int roll_die() { boost::uniform_int<> dist(1, 6); -} +} + @@ -139,7 +146,8 @@ int roll_die() { boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); -} +} + @@ -156,7 +164,8 @@ int roll_die() { boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); -} +} + @@ -173,7 +182,8 @@ int roll_die() { boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); -} +} + @@ -191,7 +201,8 @@ int roll_die() { boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist); boost::uniform_int<> dist(1, 6); -} +} + @@ -211,7 +222,8 @@ -boost::uniform_int<> dist(1, 6); +boost::uniform_int<> dist(1, 6); + diff --git a/test/code-1_1.gold b/test/code-1_1.gold index 037e2e2..d738259 100644 --- a/test/code-1_1.gold +++ b/test/code-1_1.gold @@ -28,13 +28,15 @@ { std::cout << "Hello, World!" << std::endl; return 0; -} +} +
Test 3 -print "\xfabln\xeck" +print "\xfabln\xeck" +
@@ -43,7 +45,8 @@ This isn't valid C++ but I think we should accept it; -std::cout<<"\xfabln\xeck"<<"\n"; +std::cout<<"\xfabln\xeck"<<"\n"; +
diff --git a/test/command_line_macro-1_1.gold b/test/command_line_macro-1_1.gold index d9ae4c8..423b5cb 100644 --- a/test/command_line_macro-1_1.gold +++ b/test/command_line_macro-1_1.gold @@ -6,4 +6,7 @@ bold + + empty is defined + diff --git a/test/command_line_macro-1_1.quickbook b/test/command_line_macro-1_1.quickbook index 29ad38f..5b19fc0 100644 --- a/test/command_line_macro-1_1.quickbook +++ b/test/command_line_macro-1_1.quickbook @@ -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 diff --git a/test/image-1_5.gold b/test/image-1_5.gold index 51d2d5c..6364ded 100644 --- a/test/image-1_5.gold +++ b/test/image-1_5.gold @@ -3,11 +3,24 @@
Images 1.5 - - - - + + test + + + + test this + + + + test&this + + + + test + + Foo @@ -27,15 +40,25 @@ - - + + test + + + + test + + comment - + + + test + +
diff --git a/test/include/code-import.gold b/test/include/code-import.gold index ed62313..12089ec 100644 --- a/test/include/code-import.gold +++ b/test/include/code-import.gold @@ -28,7 +28,8 @@ { // return 'em, foo man! return "foo"; -} +} + This is the Python foo @@ -55,7 +56,8 @@ def foo(): # return 'em, foo man! - return "foo" + return "foo" + This is the C foo function. @@ -83,7 +85,8 @@ { // return 'em, foo man! return "foo"; -} +} + class x @@ -107,7 +110,8 @@ { n = n_; } -}; +}; + diff --git a/test/include/code-include.gold b/test/include/code-include.gold index 9b9156c..8b3a06d 100644 --- a/test/include/code-include.gold +++ b/test/include/code-include.gold @@ -31,7 +31,8 @@ { // return 'em, foo man! return "foo"; -} +} + This should appear when stub.py is included. diff --git a/test/list_test-1_5.quickbook b/test/list_test-1_5.quickbook index ebec5c2..ab78e6f 100644 --- a/test/list_test-1_5.quickbook +++ b/test/list_test-1_5.quickbook @@ -9,8 +9,8 @@ Simple list: Simple list: -# A -# B +#A +#B Two level list: diff --git a/test/list_test-1_6.quickbook b/test/list_test-1_6.quickbook index 030342e..05efb5d 100644 --- a/test/list_test-1_6.quickbook +++ b/test/list_test-1_6.quickbook @@ -9,8 +9,8 @@ Simple list: Simple list: -# A -# B +#A +#B Two level list: diff --git a/test/quickbook_manual-1_4.gold b/test/quickbook_manual-1_4.gold index e4cb479..86d2eda 100644 --- a/test/quickbook_manual-1_4.gold +++ b/test/quickbook_manual-1_4.gold @@ -733,7 +733,8 @@ And one for the little boy who lives down the lane. { std::cout << "Hello, World!" << std::endl; return 0; -} +} +
@@ -1762,7 +1763,11 @@ sf_logo Now everywhere the sf_logo is placed, the picture will be inlined. - + + + sflogo + + @@ -1799,7 +1804,11 @@ sf_logo Hi Spirit + fileref="images/smiley.png"> + + smiley + +
@@ -2210,8 +2219,12 @@ for the journey to old age.]]] - - An eye catching advertisement or note... + + + smiley + + An eye catching advertisement + or note... Spirit is an object-oriented @@ -2452,7 +2465,8 @@ for the journey to old age.]]] { std::cout << "Hello, World!" << std::endl; return 0; -} +} + @@ -2613,7 +2627,8 @@ for the journey to old age.]]] { // return 'em, foo man! return "foo"; -} +} + This is the bar function @@ -2623,7 +2638,8 @@ for the journey to old age.]]] { // return 'em, bar man! return "bar"; -} +} + Some trailing text here @@ -2686,7 +2702,8 @@ for the journey to old age.]]] std::string foo_bar() { return "foo-bar"; -} +} + @@ -2968,10 +2985,13 @@ for the journey to old age.]]] - - You may submit your settings, tips, and suggestions to the authors, or through - the docs Boost - Docs mailing list. + + + note + + You may submit your settings, tips, and suggestions to + the authors, or through the docs + Boost Docs mailing list.
@@ -2987,8 +3007,11 @@ for the journey to old age.]]] - - SciTE can be downloaded from http://www.scintilla.org/SciTE.html + + + tip + + SciTE can be downloaded from http://www.scintilla.org/SciTE.html @@ -3009,8 +3032,11 @@ comment.box.end.props=] - - Thanks to Rene Rivera for the above SciTE settings. + + + note + + Thanks to Rene Rivera for the above SciTE settings.
diff --git a/test/snippets/pass_thru.gold b/test/snippets/pass_thru.gold index bba8526..dde5deb 100644 --- a/test/snippets/pass_thru.gold +++ b/test/snippets/pass_thru.gold @@ -10,7 +10,8 @@ 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) -=============================================================================*/ +=============================================================================*/ + struct Foo{ @@ -23,10 +24,12 @@ int main() { Foo x; -} +} + def foo: - print('foo') + print('foo') + diff --git a/test/snippets/unbalanced_snippet1-1_5.gold b/test/snippets/unbalanced_snippet1-1_5.gold index 2089905..1f9115c 100644 --- a/test/snippets/unbalanced_snippet1-1_5.gold +++ b/test/snippets/unbalanced_snippet1-1_5.gold @@ -4,6 +4,7 @@ xmlns:xi="http://www.w3.org/2001/XInclude"> Unbalanced snippet fail test 1 -int main() {} +int main() {} + diff --git a/test/svg-1_1.gold b/test/svg-1_1.gold index 091014d..a8a49b0 100644 --- a/test/svg-1_1.gold +++ b/test/svg-1_1.gold @@ -4,8 +4,15 @@ SVG test - + fileref="images/open_clipart_library_logo.svg" format="SVG"> + + open_clipart_library_logo + + + + missing_image + +