Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75521 - in branches/quickbook-dev/tools/quickbook: src test
From: dnljms_at_[hidden]
Date: 2011-11-17 16:01:57


Author: danieljames
Date: 2011-11-17 16:01:55 EST (Thu, 17 Nov 2011)
New Revision: 75521
URL: http://svn.boost.org/trac/boost/changeset/75521

Log:
Quickbook: Fix the preformatted parser for 1.6.

In the old parser, the `eol` never matched anything because the `space`
would gobble up any newlines, so I'm pretty sure the intent was to use
`blank` to remove any leading spaces. So do that in 1.6.
Added:
   branches/quickbook-dev/tools/quickbook/test/preformatted-1_6.gold
      - copied, changed from r75446, /branches/quickbook-dev/tools/quickbook/test/preformatted-1_1.gold
   branches/quickbook-dev/tools/quickbook/test/preformatted-1_6.quickbook
      - copied, changed from r75446, /branches/quickbook-dev/tools/quickbook/test/preformatted-1_1.quickbook
Text files modified:
   branches/quickbook-dev/tools/quickbook/src/block_element_grammar.cpp | 5 +++--
   branches/quickbook-dev/tools/quickbook/test/Jamfile.v2 | 1 +
   branches/quickbook-dev/tools/quickbook/test/preformatted-1_1.gold | 14 ++++++++++++++
   branches/quickbook-dev/tools/quickbook/test/preformatted-1_1.quickbook | 10 ++++++++++
   branches/quickbook-dev/tools/quickbook/test/preformatted-1_6.gold | 16 +++++++++++++++-
   branches/quickbook-dev/tools/quickbook/test/preformatted-1_6.quickbook | 11 +++++++++++
   6 files changed, 54 insertions(+), 3 deletions(-)

Modified: branches/quickbook-dev/tools/quickbook/src/block_element_grammar.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/block_element_grammar.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/block_element_grammar.cpp 2011-11-17 16:01:55 EST (Thu, 17 Nov 2011)
@@ -110,8 +110,9 @@
             ;
 
         local.preformatted =
- space
- >> !eol
+ ( qbk_before(106) >> space
+ | qbk_since(106) >> blank >> !eol
+ )
>> actions.scoped_no_eols()
                 [ local.inner_phrase
                 ]

Modified: branches/quickbook-dev/tools/quickbook/test/Jamfile.v2
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/Jamfile.v2 (original)
+++ branches/quickbook-dev/tools/quickbook/test/Jamfile.v2 2011-11-17 16:01:55 EST (Thu, 17 Nov 2011)
@@ -70,6 +70,7 @@
     [ quickbook-test para_test-1_5 ]
     [ quickbook-error-test post_process-fail ]
     [ quickbook-test preformatted-1_1 ]
+ [ quickbook-test preformatted-1_6 ]
     [ quickbook-test role-1_6 ]
     [ quickbook-test section-1_4 ]
     [ quickbook-test section-1_5-unclosed ]

Modified: branches/quickbook-dev/tools/quickbook/test/preformatted-1_1.gold
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/preformatted-1_1.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/preformatted-1_1.gold 2011-11-17 16:01:55 EST (Thu, 17 Nov 2011)
@@ -22,5 +22,19 @@
       the right, aligning under <code><phrase role="identifier">main</phrase></code>,
       on line 3.
     </para>
+ <para>
+ Here's a one line function definitition:
+ </para>
+<programlisting>void something(); </programlisting>
+ <para>
+ .
+ </para>
+ <para>
+ And some indented code:
+ </para>
+<programlisting>void go()
+ {
+ }
+</programlisting>
   </section>
 </article>

Modified: branches/quickbook-dev/tools/quickbook/test/preformatted-1_1.quickbook
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/preformatted-1_1.quickbook (original)
+++ branches/quickbook-dev/tools/quickbook/test/preformatted-1_1.quickbook 2011-11-17 16:01:55 EST (Thu, 17 Nov 2011)
@@ -19,4 +19,14 @@
 no syntax highlighting. The fifth and sixth lines should appear indented to the
 right, aligning under `main`, on line 3.
 
+Here's a one line function definitition: [pre void something(); ].
+
+And some indented code:
+
+[pre
+ void go()
+ {
+ }
+]
+
 [endsect]

Copied: branches/quickbook-dev/tools/quickbook/test/preformatted-1_6.gold (from r75446, /branches/quickbook-dev/tools/quickbook/test/preformatted-1_1.gold)
==============================================================================
--- /branches/quickbook-dev/tools/quickbook/test/preformatted-1_1.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/preformatted-1_6.gold 2011-11-17 16:01:55 EST (Thu, 17 Nov 2011)
@@ -4,7 +4,7 @@
  xmlns:xi="http://www.w3.org/2001/XInclude">
   <title>Preformatted</title>
   <section id="preformatted.preformatted">
- <title>Preformatted</title>
+ <title><link linkend="preformatted.preformatted">Preformatted</link></title>
     <para>
       Here's the ubiquitous <emphasis>Hello World</emphasis> program in C++.
     </para>
@@ -22,5 +22,19 @@
       the right, aligning under <code><phrase role="identifier">main</phrase></code>,
       on line 3.
     </para>
+ <para>
+ Here's a one line function definitition:
+ </para>
+<programlisting>void something(); </programlisting>
+ <para>
+ .
+ </para>
+ <para>
+ And some indented code:
+ </para>
+<programlisting> void go()
+ {
+ }
+</programlisting>
   </section>
 </article>

Copied: branches/quickbook-dev/tools/quickbook/test/preformatted-1_6.quickbook (from r75446, /branches/quickbook-dev/tools/quickbook/test/preformatted-1_1.quickbook)
==============================================================================
--- /branches/quickbook-dev/tools/quickbook/test/preformatted-1_1.quickbook (original)
+++ branches/quickbook-dev/tools/quickbook/test/preformatted-1_6.quickbook 2011-11-17 16:01:55 EST (Thu, 17 Nov 2011)
@@ -1,4 +1,5 @@
 [article Preformatted
+[quickbook 1.6]
 ]
 
 [section Preformatted]
@@ -19,4 +20,14 @@
 no syntax highlighting. The fifth and sixth lines should appear indented to the
 right, aligning under `main`, on line 3.
 
+Here's a one line function definitition: [pre void something(); ].
+
+And some indented code:
+
+[pre
+ void go()
+ {
+ }
+]
+
 [endsect]


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