Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85286 - in trunk/tools/quickbook: src test
From: dnljms_at_[hidden]
Date: 2013-08-10 15:17:21


Author: danieljames
Date: 2013-08-10 15:17:21 EDT (Sat, 10 Aug 2013)
New Revision: 85286
URL: http://svn.boost.org/trac/boost/changeset/85286

Log:
Be a little smarter about skipping escaped templates.

Only possible since I made escaping punctuation templates illegal.

Text files modified:
   trunk/tools/quickbook/src/main_grammar.cpp | 3 ++-
   trunk/tools/quickbook/test/templates-1_6.gold | 12 ++++++++++++
   trunk/tools/quickbook/test/templates-1_6.quickbook | 11 ++++++++++-
   trunk/tools/quickbook/test/templates-1_7.gold | 19 +++++++++++++++++++
   trunk/tools/quickbook/test/templates-1_7.quickbook | 16 ++++++++++++++++
   5 files changed, 59 insertions(+), 2 deletions(-)

Modified: trunk/tools/quickbook/src/main_grammar.cpp
==============================================================================
--- trunk/tools/quickbook/src/main_grammar.cpp Sat Aug 10 15:16:46 2013 (r85285)
+++ trunk/tools/quickbook/src/main_grammar.cpp 2013-08-10 15:17:21 EDT (Sat, 10 Aug 2013) (r85286)
@@ -606,7 +606,8 @@
 
         skip_entity =
                 '['
- >> !cl::ch_p('`')
+ // For escaped templates:
+ >> !(space >> cl::ch_p('`') >> (cl::alpha_p | '_'))
>> *(~cl::eps_p(']') >> skip_entity)
>> !cl::ch_p(']')
             | local.skip_code_block

Modified: trunk/tools/quickbook/test/templates-1_6.gold
==============================================================================
--- trunk/tools/quickbook/test/templates-1_6.gold Sat Aug 10 15:16:46 2013 (r85285)
+++ trunk/tools/quickbook/test/templates-1_6.gold 2013-08-10 15:17:21 EDT (Sat, 10 Aug 2013) (r85286)
@@ -233,6 +233,18 @@
     <para>
       <emphasis>Argument</emphasis>
     </para>
+ <orderedlist>
+ <listitem>
+<programlisting><phrase role="identifier">code</phrase></programlisting>
+ </listitem>
+ </orderedlist>
+ <orderedlist>
+ <listitem>
+ <para>
+ <code><phrase role="identifier">code</phrase></code>
+ </para>
+ </listitem>
+ </orderedlist>
   </section>
   <section id="template_1_6.escaped_templates">
     <title><link linkend="template_1_6.escaped_templates">Escaped templates</link></title>

Modified: trunk/tools/quickbook/test/templates-1_6.quickbook
==============================================================================
--- trunk/tools/quickbook/test/templates-1_6.quickbook Sat Aug 10 15:16:46 2013 (r85285)
+++ trunk/tools/quickbook/test/templates-1_6.quickbook 2013-08-10 15:17:21 EDT (Sat, 10 Aug 2013) (r85286)
@@ -285,9 +285,18 @@
 [section:template_body Skipping the template body correctly]
 
 [template args1[x] [`x]]
+[template args2[]
+[ordered_list [``code``]]
+]
+[/ Due to a bug in the template parser need to stop the parser
+ thinking that the code is an escaped template. ]
+[template args3[]
+[ordered_list [\ `code`]]
+]
 
 [args1 <emphasis>Argument</emphasis>]
-
+[args2]
+[args3]
 
 [endsect]
 

Modified: trunk/tools/quickbook/test/templates-1_7.gold
==============================================================================
--- trunk/tools/quickbook/test/templates-1_7.gold Sat Aug 10 15:16:46 2013 (r85285)
+++ trunk/tools/quickbook/test/templates-1_7.gold 2013-08-10 15:17:21 EDT (Sat, 10 Aug 2013) (r85286)
@@ -272,6 +272,25 @@
       * Not a list.
     </para>
   </section>
+ <section id="template_1_7.template_body">
+ <title><link linkend="template_1_7.template_body">Skipping the template body
+ correctly</link></title>
+ <para>
+ <emphasis>Argument</emphasis>
+ </para>
+ <orderedlist>
+ <listitem>
+<programlisting><phrase role="identifier">code</phrase></programlisting>
+ </listitem>
+ </orderedlist>
+ <orderedlist>
+ <listitem>
+ <para>
+ <code><phrase role="identifier">code</phrase></code>
+ </para>
+ </listitem>
+ </orderedlist>
+ </section>
   <section id="template_1_7.escaped_templates">
     <title><link linkend="template_1_7.escaped_templates">Escaped templates</link></title>
     <para>

Modified: trunk/tools/quickbook/test/templates-1_7.quickbook
==============================================================================
--- trunk/tools/quickbook/test/templates-1_7.quickbook Sat Aug 10 15:16:46 2013 (r85285)
+++ trunk/tools/quickbook/test/templates-1_7.quickbook 2013-08-10 15:17:21 EDT (Sat, 10 Aug 2013) (r85286)
@@ -293,6 +293,22 @@
 
 [endsect]
 
+[/-------------------------------- Skipping template body ]
+
+[section:template_body Skipping the template body correctly]
+
+[template args1[x] [`x]]
+[template args2[] [ordered_list [``code``]]]
+[/ Due to a bug in the template parser need to stop the parser
+ thinking that the code is an escaped template. ]
+[template args3[] [ordered_list [\ `code`]]]
+
+[args1 <emphasis>Argument</emphasis>]
+[args2]
+[args3]
+
+[endsect]
+
 [/----------------------------------- Escaped templates ]
 
 [section Escaped templates]


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