|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r63619 - in branches/quickbook-1.5-spirit2: . doc test
From: daniel_james_at_[hidden]
Date: 2010-07-04 14:33:59
Author: danieljames
Date: 2010-07-04 14:33:57 EDT (Sun, 04 Jul 2010)
New Revision: 63619
URL: http://svn.boost.org/trac/boost/changeset/63619
Log:
Merge from trunk.
Also had to add a check for empty paragraphs to avoid writing out empty
paragraphs between block templates - which would be tricky to detect in the
grammar.
Added:
branches/quickbook-1.5-spirit2/test/doc-info-3.gold
- copied unchanged from r63612, /trunk/tools/quickbook/test/doc-info-3.gold
branches/quickbook-1.5-spirit2/test/doc-info-3.quickbook
- copied unchanged from r63612, /trunk/tools/quickbook/test/doc-info-3.quickbook
branches/quickbook-1.5-spirit2/test/doc-info-4.gold
- copied unchanged from r63612, /trunk/tools/quickbook/test/doc-info-4.gold
branches/quickbook-1.5-spirit2/test/doc-info-4.quickbook
- copied unchanged from r63612, /trunk/tools/quickbook/test/doc-info-4.quickbook
branches/quickbook-1.5-spirit2/test/empty.quickbook
- copied unchanged from r63612, /trunk/tools/quickbook/test/empty.quickbook
branches/quickbook-1.5-spirit2/test/mismatched-brackets-1.gold
- copied unchanged from r63612, /trunk/tools/quickbook/test/mismatched-brackets-1.gold
branches/quickbook-1.5-spirit2/test/mismatched-brackets-1.quickbook
- copied unchanged from r63612, /trunk/tools/quickbook/test/mismatched-brackets-1.quickbook
branches/quickbook-1.5-spirit2/test/mismatched-brackets-2.gold
- copied unchanged from r63612, /trunk/tools/quickbook/test/mismatched-brackets-2.gold
branches/quickbook-1.5-spirit2/test/mismatched-brackets-2.quickbook
- copied unchanged from r63612, /trunk/tools/quickbook/test/mismatched-brackets-2.quickbook
branches/quickbook-1.5-spirit2/test/mismatched-brackets-3.quickbook
- copied unchanged from r63612, /trunk/tools/quickbook/test/mismatched-brackets-3.quickbook
Properties modified:
branches/quickbook-1.5-spirit2/ (props changed)
Text files modified:
branches/quickbook-1.5-spirit2/block_grammar.cpp | 2 +-
branches/quickbook-1.5-spirit2/doc/Jamfile.v2 | 4 +---
branches/quickbook-1.5-spirit2/doc/quickbook.qbk | 16 ++++++++--------
branches/quickbook-1.5-spirit2/doc_info_grammar.cpp | 10 +++++++---
branches/quickbook-1.5-spirit2/state.cpp | 14 +++++++++++++-
branches/quickbook-1.5-spirit2/template.cpp | 8 ++++++--
branches/quickbook-1.5-spirit2/test/Jamfile.v2 | 5 +++++
branches/quickbook-1.5-spirit2/test/doc-info-1.gold | 11 ++++++++---
branches/quickbook-1.5-spirit2/test/doc-info-1.quickbook | 5 ++---
branches/quickbook-1.5-spirit2/test/doc-info-2.gold | 11 ++++++++---
branches/quickbook-1.5-spirit2/test/doc-info-2.quickbook | 3 ++-
branches/quickbook-1.5-spirit2/test/include_1_5.quickbook | 2 ++
branches/quickbook-1.5-spirit2/test/quickbook-manual.gold | 4 ----
branches/quickbook-1.5-spirit2/test/templates.gold | 3 +++
branches/quickbook-1.5-spirit2/test/templates.quickbook | 37 +++++++++++++++++++++++++++++++++++++
branches/quickbook-1.5-spirit2/test/templates_1_4.quickbook | 3 +--
16 files changed, 104 insertions(+), 34 deletions(-)
Modified: branches/quickbook-1.5-spirit2/block_grammar.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/block_grammar.cpp (original)
+++ branches/quickbook-1.5-spirit2/block_grammar.cpp 2010-07-04 14:33:57 EDT (Sun, 04 Jul 2010)
@@ -48,7 +48,7 @@
;
local.blocks =
- +( local.block_markup
+ *( local.block_markup
| indented_code [actions.process]
| local.list [actions.process]
| local.hr [actions.process]
Modified: branches/quickbook-1.5-spirit2/doc/Jamfile.v2
==============================================================================
--- branches/quickbook-1.5-spirit2/doc/Jamfile.v2 (original)
+++ branches/quickbook-1.5-spirit2/doc/Jamfile.v2 2010-07-04 14:33:57 EDT (Sun, 04 Jul 2010)
@@ -15,15 +15,13 @@
xml quickbook : quickbook.qbk ;
-path-constant images : ../../../doc/html ;
+path-constant images : ../../../doc/src ;
boostbook standalone
:
quickbook
:
<xsl:param>boost.root=../../../..
- <xsl:param>boost.libraries=../../../../libs/libraries.htm
- <xsl:param>html.stylesheet=../../../../doc/html/boostbook.css
<xsl:param>generate.section.toc.level=3
<xsl:param>chunk.section.depth=2
<xsl:param>chunk.first.sections=1
Modified: branches/quickbook-1.5-spirit2/doc/quickbook.qbk
==============================================================================
--- branches/quickbook-1.5-spirit2/doc/quickbook.qbk (original)
+++ branches/quickbook-1.5-spirit2/doc/quickbook.qbk 2010-07-04 14:33:57 EDT (Sun, 04 Jul 2010)
@@ -19,10 +19,7 @@
[/ Some links]
-[def __note__ [$images/note.png]]
-[def __alert__ [$images/alert.png]]
-[def __tip__ [$images/tip.png]]
-[def :-) [$images/smiley.png]]
+[def :-) [$../src/images/smiley.png]]
[def __spirit__ [@http://spirit.sourceforge.net Spirit]]
[def __boostbook__ [@http://www.boost.org/doc/html/boostbook.html BoostBook]]
[def __docbook__ [@http://www.docbook.org/ DocBook]]
@@ -204,6 +201,9 @@
* If a line starts with a comment, interpret it as a paragraph even if it's
followed by whitespace or a list character.
* Don't treat 4+ consecutive blank lines as multiple paragraph breaks.
+* Don't require commas between authors in docinfo.
+* Allow empty document bodies.
+* Less empty paragraphs.
[endsect]
@@ -760,7 +760,7 @@
[copyright 2000 2002 2003 Joe Blow, Jane Doe]
[purpose The document's reason for being]
[category The document's category]
- [authors [Blow, Joe], [Doe, Jane]]
+ [authors [Blow, Joe] [Doe, Jane]]
[license The document's license]
[source-mode source-type]
]
@@ -2087,7 +2087,7 @@
powerful. The following sections list the settings for some editors which can
help make editing quickbook files a bit easier.
-[blurb __note__ You may submit your settings, tips, and suggestions to the
+[note You may submit your settings, tips, and suggestions to the
authors, or through the [@https://lists.sourceforge.net/lists/listinfo/boost-
docs Boost Docs mailing list].]
@@ -2098,7 +2098,7 @@
The Scintilla Text Editor (SciTE) is a free source code editor for Win32 and X.
It uses the SCIntilla source code editing component.
-[blurb __tip__ SciTE can be downloaded from [@http://www.scintilla.org/SciTE.html]]
+[tip SciTE can be downloaded from [@http://www.scintilla.org/SciTE.html]]
You can use the following settings to highlight quickbook tags when
editing quickbook files.
@@ -2117,7 +2117,7 @@
comment.box.end.props=]
''']
-[blurb __note__ Thanks to Rene Rivera for the above SciTE settings.]
+[note Thanks to Rene Rivera for the above SciTE settings.]
[endsect] [/scite]
Modified: branches/quickbook-1.5-spirit2/doc_info_grammar.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/doc_info_grammar.cpp (original)
+++ branches/quickbook-1.5-spirit2/doc_info_grammar.cpp 2010-07-04 14:33:57 EDT (Sun, 04 Jul 2010)
@@ -148,8 +148,7 @@
;
local.doc_author =
- space
- >> '['
+ '['
>> space
>> (*~qi::char_(',')) [member_assign(&doc_info::author::surname)]
>> ',' >> space
@@ -157,7 +156,12 @@
>> ']'
;
- local.doc_authors = "authors" >> hard_space >> (local.doc_author % ',') ;
+ local.doc_authors
+ = "authors"
+ >> hard_space
+ >> ( (local.doc_author >> space)
+ % -(qi::char_(',') >> space)
+ );
local.doc_license =
"license" >> hard_space
Modified: branches/quickbook-1.5-spirit2/state.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/state.cpp (original)
+++ branches/quickbook-1.5-spirit2/state.cpp 2010-07-04 14:33:57 EDT (Sun, 04 Jul 2010)
@@ -102,7 +102,19 @@
std::string paragraph;
phrase.swap(paragraph);
- if(!paragraph.empty()) {
+ // TODO: Use spirit to do this?
+
+ std::string::const_iterator
+ pos = paragraph.begin(),
+ end = paragraph.end();
+
+ while(pos != paragraph.end() && (
+ *pos == ' ' || *pos == '\t' || *pos == '\n' || *pos == '\r'))
+ {
+ ++pos;
+ }
+
+ if(pos != end) {
actions a(*this);
quickbook::paragraph p;
Modified: branches/quickbook-1.5-spirit2/template.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/template.cpp (original)
+++ branches/quickbook-1.5-spirit2/template.cpp 2010-07-04 14:33:57 EDT (Sun, 04 Jul 2010)
@@ -326,7 +326,9 @@
first.set_position(template_pos);
iterator last(body.end(), body.end());
r = boost::spirit::qi::parse(first, last, g.simple_phrase) && first == last;
- state.phrase.swap(result);
+ std::string phrase;
+ state.phrase.swap(phrase);
+ result = phrase;
}
else
{
@@ -349,7 +351,9 @@
r = boost::spirit::qi::parse(first, last, g.block) && first == last;
state.paragraph_output();
- state.block.swap(result);
+ std::string block;
+ state.block.swap(block);
+ result = block;
}
return r;
Modified: branches/quickbook-1.5-spirit2/test/Jamfile.v2
==============================================================================
--- branches/quickbook-1.5-spirit2/test/Jamfile.v2 (original)
+++ branches/quickbook-1.5-spirit2/test/Jamfile.v2 2010-07-04 14:33:57 EDT (Sun, 04 Jul 2010)
@@ -24,6 +24,9 @@
[ quickbook-test templates_1_4 ]
[ quickbook-test templates_1_5 ]
[ quickbook-test template-section ]
+ [ quickbook-test mismatched-brackets-1 ]
+ [ quickbook-test mismatched-brackets-2 ]
+ [ quickbook-fail-test mismatched-brackets-3 ]
#[ quickbook-test xinclude ]
[ quickbook-test import ]
[ quickbook-test include_1_5 ]
@@ -41,6 +44,8 @@
[ quickbook-test cond_phrase ]
[ quickbook-test doc-info-1 ]
[ quickbook-test doc-info-2 ]
+ [ quickbook-test doc-info-3 ]
+ [ quickbook-test doc-info-4 ]
[ quickbook-test callouts ]
[ quickbook-test simple_markup ]
[ quickbook-test xml-escape_1_2 ]
Modified: branches/quickbook-1.5-spirit2/test/doc-info-1.gold
==============================================================================
--- branches/quickbook-1.5-spirit2/test/doc-info-1.gold (original)
+++ branches/quickbook-1.5-spirit2/test/doc-info-1.gold 2010-07-04 14:33:57 EDT (Sun, 04 Jul 2010)
@@ -4,8 +4,13 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<title>Document Information 1</title>
<articleinfo>
+ <authorgroup>
+ <author>
+ <firstname>Joe</firstname> <surname>Blow</surname>
+ </author>
+ <author>
+ <firstname>Jane</firstname> <surname>Doe</surname>
+ </author>
+ </authorgroup>
</articleinfo>
- <para>
- The body is largely irrelevant.
- </para>
</article>
Modified: branches/quickbook-1.5-spirit2/test/doc-info-1.quickbook
==============================================================================
--- branches/quickbook-1.5-spirit2/test/doc-info-1.quickbook (original)
+++ branches/quickbook-1.5-spirit2/test/doc-info-1.quickbook 2010-07-04 14:33:57 EDT (Sun, 04 Jul 2010)
@@ -1,9 +1,8 @@
[article Document Information 1
[quickbook 1.5]
+[authors [Blow, Joe], [Doe, Jane]]
[source-mode teletype]
[purpose Inline code test: `1 + 2`]
[category tests]
[category irrelevance]
-]
-
-The body is largely irrelevant.
\ No newline at end of file
+]
\ No newline at end of file
Modified: branches/quickbook-1.5-spirit2/test/doc-info-2.gold
==============================================================================
--- branches/quickbook-1.5-spirit2/test/doc-info-2.gold (original)
+++ branches/quickbook-1.5-spirit2/test/doc-info-2.gold 2010-07-04 14:33:57 EDT (Sun, 04 Jul 2010)
@@ -3,13 +3,18 @@
<library id="document_information_1" name="Document Information 1" dirname="document_information_1"
last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude">
<libraryinfo>
+ <authorgroup>
+ <author>
+ <firstname>Joe</firstname> <surname>Blow</surname>
+ </author>
+ <author>
+ <firstname>Jane</firstname> <surname>Doe</surname>
+ </author>
+ </authorgroup>
<librarypurpose>
Inline code test: <code>1 + 2</code>
</librarypurpose>
<librarycategory name="category:tests"></librarycategory> <librarycategory name="category:irrelevance"></librarycategory>
</libraryinfo>
<title>Document Information 1</title>
- <para>
- The body is largely irrelevant.
- </para>
</library>
Modified: branches/quickbook-1.5-spirit2/test/doc-info-2.quickbook
==============================================================================
--- branches/quickbook-1.5-spirit2/test/doc-info-2.quickbook (original)
+++ branches/quickbook-1.5-spirit2/test/doc-info-2.quickbook 2010-07-04 14:33:57 EDT (Sun, 04 Jul 2010)
@@ -1,9 +1,10 @@
[library Document Information 1
[quickbook 1.5]
+[authors [Blow, Joe] [Doe, Jane]]
[source-mode teletype]
[purpose Inline code test: `1 + 2`]
[category tests]
[category irrelevance]
]
-The body is largely irrelevant.
\ No newline at end of file
+[/ Some comment]
\ No newline at end of file
Modified: branches/quickbook-1.5-spirit2/test/include_1_5.quickbook
==============================================================================
--- branches/quickbook-1.5-spirit2/test/include_1_5.quickbook (original)
+++ branches/quickbook-1.5-spirit2/test/include_1_5.quickbook 2010-07-04 14:33:57 EDT (Sun, 04 Jul 2010)
@@ -6,3 +6,5 @@
[include include-sub.quickbook]
[include include-sub2.quickbook]
[include:foo include-sub2.quickbook]
+[include empty.quickbook]
+
Modified: branches/quickbook-1.5-spirit2/test/quickbook-manual.gold
==============================================================================
--- branches/quickbook-1.5-spirit2/test/quickbook-manual.gold (original)
+++ branches/quickbook-1.5-spirit2/test/quickbook-manual.gold 2010-07-04 14:33:57 EDT (Sun, 04 Jul 2010)
@@ -2063,8 +2063,6 @@
Hi, my name is James Bond. I am 39 years old. I am a Spy.
</para>
<para>
- </para>
- <para>
Hi, my name is Santa Clause. I am 87 years old. I am a Big Red Fatso.
</para>
<caution>
@@ -2719,8 +2717,6 @@
</programlisting>
</para>
<para>
- </para>
- <para>
This is the <emphasis role="bold"><emphasis>bar</emphasis></emphasis> function
</para>
<para>
Modified: branches/quickbook-1.5-spirit2/test/templates.gold
==============================================================================
--- branches/quickbook-1.5-spirit2/test/templates.gold (original)
+++ branches/quickbook-1.5-spirit2/test/templates.gold 2010-07-04 14:33:57 EDT (Sun, 04 Jul 2010)
@@ -63,4 +63,7 @@
[fool]
</para>
</section>
+ <section id="templates.empty_templates">
+ <title><link linkend="templates.empty_templates">Empty Templates</link></title>
+ </section>
</article>
Modified: branches/quickbook-1.5-spirit2/test/templates.quickbook
==============================================================================
--- branches/quickbook-1.5-spirit2/test/templates.quickbook (original)
+++ branches/quickbook-1.5-spirit2/test/templates.quickbook 2010-07-04 14:33:57 EDT (Sun, 04 Jul 2010)
@@ -105,5 +105,42 @@
[template foo 1]
[fool]
+[template blah 10]
+
[endsect]
+[section Empty Templates]
+
+[template empty1]
+[template empty2 ]
+[template empty3 [/comment]]
+[template empty4 [/comment]
+
+]
+[template empty5
+]
+[template empty6
+
+]
+[template empty7
+[/comment]
+]
+[template empty8
+
+[/comment]
+]
+[template empty_arg1[x]]
+[template empty_arg2[x y]]
+
+[empty1]
+[empty2]
+[empty3]
+[empty4]
+[empty5]
+[empty6]
+[empty7]
+[empty8]
+[empty_arg1 1]
+[empty_arg2 1 2]
+
+[endsect]
\ No newline at end of file
Modified: branches/quickbook-1.5-spirit2/test/templates_1_4.quickbook
==============================================================================
--- branches/quickbook-1.5-spirit2/test/templates_1_4.quickbook (original)
+++ branches/quickbook-1.5-spirit2/test/templates_1_4.quickbook 2010-07-04 14:33:57 EDT (Sun, 04 Jul 2010)
@@ -27,8 +27,7 @@
[binary 1.\.2..3] [/ {1..2-3} ]
[binary 1.\.2 3] [/ {1..2-3} ]
-[binary [binary 1 2..3] 4] [/ {[binary 1 2- {1 2-y}} 4] ]
-[/ This is obviously wrong, but I don't feel up to fixing it at the moment.]
+[binary [binary 1 2..3] 4] [/ {[binary 1 2-3} 4] ]
[template ternary[x y z] {[x]-[y]-[z]}]
[ternary 1..2..3] [/ {1-2-3} ]
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