Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65351 - in branches/quickbook-1.5-spirit2: src test
From: dnljms_at_[hidden]
Date: 2010-09-07 18:41:14


Author: danieljames
Date: 2010-09-07 18:41:13 EDT (Tue, 07 Sep 2010)
New Revision: 65351
URL: http://svn.boost.org/trac/boost/changeset/65351

Log:
Avoid treating lines of just whitespace as code blocks.
Text files modified:
   branches/quickbook-1.5-spirit2/src/code_grammar.cpp | 18 +++++++++++-------
   branches/quickbook-1.5-spirit2/test/para-test.gold | 3 +++
   branches/quickbook-1.5-spirit2/test/para-test.quickbook | 2 ++
   3 files changed, 16 insertions(+), 7 deletions(-)

Modified: branches/quickbook-1.5-spirit2/src/code_grammar.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/src/code_grammar.cpp (original)
+++ branches/quickbook-1.5-spirit2/src/code_grammar.cpp 2010-09-07 18:41:13 EDT (Tue, 07 Sep 2010)
@@ -45,24 +45,28 @@
         local.indented_code =
                 position [member_assign(&quickbook::code::position)]
                                                         [member_assign(&quickbook::code::flow, quickbook::code::block)]
- >> qi::raw[
- local.code_line
- >> *(*local.blank_line >> local.code_line)
- ]
+ >> qi::raw[+local.code_line % +local.blank_line]
                                                         [member_assign(&quickbook::code::content)]
>> *eol
             ;
 
         local.code_line =
- qi::char_(" \t")
- >> *(qi::char_ - eol)
- >> eol
+ qi::blank
+ >> *(qi::char_ - qi::eol)
+ > qi::eol
             ;
 
         local.blank_line =
             *qi::blank >> qi::eol
             ;
 
+ indented_code.name("indented code");
+ local.indented_code.name("indented code");
+ local.code_line.name("indented code line");
+ local.blank_line.name("blank line");
+
+ // Code block
+
         code_block = (local.code_block1 | local.code_block2) [actions.process];
 
         local.code_block1

Modified: branches/quickbook-1.5-spirit2/test/para-test.gold
==============================================================================
--- branches/quickbook-1.5-spirit2/test/para-test.gold (original)
+++ branches/quickbook-1.5-spirit2/test/para-test.gold 2010-09-07 18:41:13 EDT (Tue, 07 Sep 2010)
@@ -36,6 +36,9 @@
       Four lines before this paragraph.
     </para>
     <para>
+ A couple of spaces in the line before this paragraph.
+ </para>
+ <para>
       Last paragraph.
     </para>
   </section>

Modified: branches/quickbook-1.5-spirit2/test/para-test.quickbook
==============================================================================
--- branches/quickbook-1.5-spirit2/test/para-test.quickbook (original)
+++ branches/quickbook-1.5-spirit2/test/para-test.quickbook 2010-09-07 18:41:13 EDT (Tue, 07 Sep 2010)
@@ -34,6 +34,8 @@
 
 Four lines before this paragraph.
 
+
+A couple of spaces in the line before this paragraph.
 
 
 


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