Boost logo

Boost-Commit :

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


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

Log:
Make escaped punctuation templates illegal in 1.6.

There's a minor bug with escaped templates in 1.6 and I don't have time to
fix it, this will help limit its effect. As far as I'm aware no one uses
escaped templates with punctuation templates. Escaped templates are an
undocumented feature anyway.

Added:
   trunk/tools/quickbook/test/templates-1_6-fail1.quickbook (contents, props changed)
Text files modified:
   trunk/tools/quickbook/src/main_grammar.cpp | 22 ++++++++++++++++++----
   trunk/tools/quickbook/test/Jamfile.v2 | 1 +
   trunk/tools/quickbook/test/templates-1_6-fail1.quickbook | 8 ++++++++
   trunk/tools/quickbook/test/templates-1_6.gold | 3 +--
   trunk/tools/quickbook/test/templates-1_6.quickbook | 6 +-----
   trunk/tools/quickbook/test/templates-1_7.gold | 3 +--
   trunk/tools/quickbook/test/templates-1_7.quickbook | 6 +-----
   7 files changed, 31 insertions(+), 18 deletions(-)

Modified: trunk/tools/quickbook/src/main_grammar.cpp
==============================================================================
--- trunk/tools/quickbook/src/main_grammar.cpp Sat Aug 10 15:16:01 2013 (r85284)
+++ trunk/tools/quickbook/src/main_grammar.cpp 2013-08-10 15:16:46 EDT (Sat, 10 Aug 2013) (r85285)
@@ -642,10 +642,24 @@
             ( '['
>> space
>> state.values.list(template_tags::template_)
- [ !cl::str_p("`") [state.values.entry(ph::arg1, ph::arg2, template_tags::escape)]
- >> ( cl::eps_p(cl::punct_p)
- >> state.templates.scope [state.values.entry(ph::arg1, ph::arg2, template_tags::identifier)]
- | state.templates.scope [state.values.entry(ph::arg1, ph::arg2, template_tags::identifier)]
+ [ ( cl::str_p('`')
+ >> cl::eps_p(cl::punct_p)
+ >> state.templates.scope
+ [state.values.entry(ph::arg1, ph::arg2, template_tags::escape)]
+ [state.values.entry(ph::arg1, ph::arg2, template_tags::identifier)]
+ >> !qbk_ver(106u)
+ [error("Templates with punctuation names can't be escaped in quickbook 1.6+")]
+ | cl::str_p('`')
+ >> state.templates.scope
+ [state.values.entry(ph::arg1, ph::arg2, template_tags::escape)]
+ [state.values.entry(ph::arg1, ph::arg2, template_tags::identifier)]
+
+ | cl::eps_p(cl::punct_p)
+ >> state.templates.scope
+ [state.values.entry(ph::arg1, ph::arg2, template_tags::identifier)]
+
+ | state.templates.scope
+ [state.values.entry(ph::arg1, ph::arg2, template_tags::identifier)]
>> cl::eps_p(hard_space)
                     )
>> space

Modified: trunk/tools/quickbook/test/Jamfile.v2
==============================================================================
--- trunk/tools/quickbook/test/Jamfile.v2 Sat Aug 10 15:16:01 2013 (r85284)
+++ trunk/tools/quickbook/test/Jamfile.v2 2013-08-10 15:16:46 EDT (Sat, 10 Aug 2013) (r85285)
@@ -108,6 +108,7 @@
     [ quickbook-test templates-1_4 ]
     [ quickbook-test templates-1_5 ]
     [ quickbook-test templates-1_6 ]
+ [ quickbook-error-test templates-1_6-fail1 ]
     [ quickbook-test templates-1_7 ]
     [ quickbook-error-test templates-1_7-fail1 ]
     [ quickbook-test unicode_escape-1_5 ]

Added: trunk/tools/quickbook/test/templates-1_6-fail1.quickbook
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/tools/quickbook/test/templates-1_6-fail1.quickbook 2013-08-10 15:16:46 EDT (Sat, 10 Aug 2013) (r85285)
@@ -0,0 +1,8 @@
+[article Template 1.6 fail 1
+ [quickbook 1.6]
+]
+
+[/ I've removed support for escaping punctuation templates in 1.6. ]
+
+[template ~ body]
+[`~]

Modified: trunk/tools/quickbook/test/templates-1_6.gold
==============================================================================
--- trunk/tools/quickbook/test/templates-1_6.gold Sat Aug 10 15:16:01 2013 (r85284)
+++ trunk/tools/quickbook/test/templates-1_6.gold 2013-08-10 15:16:46 EDT (Sat, 10 Aug 2013) (r85285)
@@ -237,8 +237,7 @@
   <section id="template_1_6.escaped_templates">
     <title><link linkend="template_1_6.escaped_templates">Escaped templates</link></title>
     <para>
- <thingbob>Not real boostbook</thingbob> <thingbob>Also not real boostbook</thingbob>
- <thingbob>More fake boostbook</thingbob> <thingbob>Final fake boostbook</thingbob>
+ <thingbob>Not real boostbook</thingbob> <thingbob>More fake boostbook</thingbob>
     </para>
   </section>
 </article>

Modified: trunk/tools/quickbook/test/templates-1_6.quickbook
==============================================================================
--- trunk/tools/quickbook/test/templates-1_6.quickbook Sat Aug 10 15:16:01 2013 (r85284)
+++ trunk/tools/quickbook/test/templates-1_6.quickbook 2013-08-10 15:16:46 EDT (Sat, 10 Aug 2013) (r85285)
@@ -296,13 +296,9 @@
 [section Escaped templates]
 
 [template raw_markup <thingbob>Not real boostbook</thingbob>]
-[template | <thingbob>Also not real boostbook</thingbob>]
-[template escaped1 [|] [`|]]
-[template escaped2 [x] [`x]]
+[template escaped1 [x] [`x]]
 
 [`raw_markup]
-[`|]
 [escaped1 <thingbob>More fake boostbook</thingbob>]
-[escaped2 <thingbob>Final fake boostbook</thingbob>]
 
 [endsect]

Modified: trunk/tools/quickbook/test/templates-1_7.gold
==============================================================================
--- trunk/tools/quickbook/test/templates-1_7.gold Sat Aug 10 15:16:01 2013 (r85284)
+++ trunk/tools/quickbook/test/templates-1_7.gold 2013-08-10 15:16:46 EDT (Sat, 10 Aug 2013) (r85285)
@@ -275,8 +275,7 @@
   <section id="template_1_7.escaped_templates">
     <title><link linkend="template_1_7.escaped_templates">Escaped templates</link></title>
     <para>
- <thingbob>Not real boostbook</thingbob> <thingbob>Also not real boostbook</thingbob>
- <thingbob>More fake boostbook</thingbob> <thingbob>Final fake boostbook</thingbob>
+ <thingbob>Not real boostbook</thingbob> <thingbob>More fake boostbook</thingbob>
     </para>
   </section>
 </article>

Modified: trunk/tools/quickbook/test/templates-1_7.quickbook
==============================================================================
--- trunk/tools/quickbook/test/templates-1_7.quickbook Sat Aug 10 15:16:01 2013 (r85284)
+++ trunk/tools/quickbook/test/templates-1_7.quickbook 2013-08-10 15:16:46 EDT (Sat, 10 Aug 2013) (r85285)
@@ -298,13 +298,9 @@
 [section Escaped templates]
 
 [template raw_markup <thingbob>Not real boostbook</thingbob>]
-[template ~ <thingbob>Also not real boostbook</thingbob>]
-[template escaped1 [|] [`|]]
-[template escaped2 [x] [`x]]
+[template escaped1 [x] [`x]]
 
 [`raw_markup]
-[`~]
 [escaped1 <thingbob>More fake boostbook</thingbob>]
-[escaped2 <thingbob>Final fake boostbook</thingbob>]
 
 [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