Boost logo

Boost-Commit :

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


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

Log:
Make phrase_end consistent with block_separator.

phrase_end accepted whitespace/comment before the separator, so it'd
mach too early and the parser would have to back track the match - which
I'd just forbidden with the expectation operator.
Text files modified:
   branches/quickbook-1.5-spirit2/src/block_grammar.cpp | 17 ++++++++++++++---
   branches/quickbook-1.5-spirit2/src/phrase_grammar.cpp | 11 ++++++-----
   branches/quickbook-1.5-spirit2/test/table_1_5.gold | 38 ++++++++++++++++++++++++++++++++++++++
   branches/quickbook-1.5-spirit2/test/table_1_5.quickbook | 13 +++++++++++++
   4 files changed, 71 insertions(+), 8 deletions(-)

Modified: branches/quickbook-1.5-spirit2/src/block_grammar.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/src/block_grammar.cpp (original)
+++ branches/quickbook-1.5-spirit2/src/block_grammar.cpp 2010-09-07 18:40:34 EDT (Tue, 07 Sep 2010)
@@ -143,6 +143,17 @@
                 ]
             ;
 
+ local.paragraph.name("paragraph");
+ local.block_separator.name("block separator");
+
+ // Make sure that we don't go past a single block, except when
+ // preformatted.
+ phrase_end =
+ ']' | qi::eps(ph::ref(no_eols)) >> local.block_separator
+ ;
+
+ phrase_end.name("phrase end");
+
         // Parse command line macro definition. This is more here out of
         // convenience than anything.
 
@@ -153,9 +164,9 @@
>> local.command_line_macro_identifier [member_assign(&quickbook::def_macro::macro_identifier)]
>> space
>> -( '='
- >> space
- >> phrase [member_assign(&quickbook::def_macro::content)]
- >> space
+ > space
+ > phrase [member_assign(&quickbook::def_macro::content)]
+ > space
                 )
             ;
 

Modified: branches/quickbook-1.5-spirit2/src/phrase_grammar.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/src/phrase_grammar.cpp (original)
+++ branches/quickbook-1.5-spirit2/src/phrase_grammar.cpp 2010-09-07 18:40:34 EDT (Tue, 07 Sep 2010)
@@ -169,10 +169,11 @@
> qi::raw[qi::repeat(8)[qi::xdigit]] [member_assign(&quickbook::unicode_char::value)]
             ;
 
- // Make sure that we don't go past a single block, except when
- // preformatted.
- phrase_end =
- ']' | qi::eps(ph::ref(no_eols)) >> qi::eol >> *qi::blank >> qi::eol
- ;
+ escape.name("escape");
+ local.escape_break.name("line break");
+ local.escape_punct.name("escaped punctuation");
+ local.escape_markup.name("escaped markup");
+ local.escape_unicode16.name("escaped 16-bit unicode");
+ local.escape_unicode32.name("escape 32-bit unicode");
     }
 }

Modified: branches/quickbook-1.5-spirit2/test/table_1_5.gold
==============================================================================
--- branches/quickbook-1.5-spirit2/test/table_1_5.gold (original)
+++ branches/quickbook-1.5-spirit2/test/table_1_5.gold 2010-09-07 18:40:34 EDT (Tue, 07 Sep 2010)
@@ -230,5 +230,43 @@
         </tbody>
       </tgroup>
     </table>
+ <table frame="all" id="table_1_5.section1.odd">
+ <title>Odd Formatting</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>
+ <para>
+ A
+ </para>
+ </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>
+ <para>
+ B
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ Trailing space
+ </para>
+ </entry>
+ <entry>
+ <para>
+ Trailing space
+ </para>
+ <para>
+ Next paragraph.
+ </para>
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
   </section>
 </article>

Modified: branches/quickbook-1.5-spirit2/test/table_1_5.quickbook
==============================================================================
--- branches/quickbook-1.5-spirit2/test/table_1_5.quickbook (original)
+++ branches/quickbook-1.5-spirit2/test/table_1_5.quickbook 2010-09-07 18:40:34 EDT (Tue, 07 Sep 2010)
@@ -69,4 +69,17 @@
   ]
 ]
 
+[table:odd Odd Formatting
+ [[A]][[B]]
+ [
+ [
+ Trailing space
+ ]
+ [
+ Trailing space
+
+ Next paragraph.
+ ]
+ ]
+]
 [endsect]
\ 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