Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54816 - in trunk/tools/quickbook: . test
From: daniel_james_at_[hidden]
Date: 2009-07-08 17:41:01


Author: danieljames
Date: 2009-07-08 17:41:00 EDT (Wed, 08 Jul 2009)
New Revision: 54816
URL: http://svn.boost.org/trac/boost/changeset/54816

Log:
Make sure that a template expansion ends with a ']'.

{{{
[template foo 1]
[fool]
}}}

was generating `1[fool]` - the template would be expanded but then when it
didn't match the `]` it would fail and just get copied to the output. This
change checks for `]` before expanding the template. So it now generates
`[fool]` which is an improvement.

I'm not including a version switch as I see this as a plain bug fix - I can't
imagine this change ever being anything but beneficial.
Text files modified:
   trunk/tools/quickbook/phrase.hpp | 1 +
   trunk/tools/quickbook/test/templates.gold | 3 +++
   trunk/tools/quickbook/test/templates.quickbook | 6 ++++++
   3 files changed, 10 insertions(+), 0 deletions(-)

Modified: trunk/tools/quickbook/phrase.hpp
==============================================================================
--- trunk/tools/quickbook/phrase.hpp (original)
+++ trunk/tools/quickbook/phrase.hpp 2009-07-08 17:41:00 EDT (Wed, 08 Jul 2009)
@@ -145,6 +145,7 @@
>> !(hard_space
>> template_args)
                     ) )
+ >> eps_p(']')
                     ;
 
                 brackets =

Modified: trunk/tools/quickbook/test/templates.gold
==============================================================================
--- trunk/tools/quickbook/test/templates.gold (original)
+++ trunk/tools/quickbook/test/templates.gold 2009-07-08 17:41:00 EDT (Wed, 08 Jul 2009)
@@ -67,5 +67,8 @@
     <para>
       .0 00
     </para>
+ <para>
+ [fool]
+ </para>
   </section>
 </article>

Modified: trunk/tools/quickbook/test/templates.quickbook
==============================================================================
--- trunk/tools/quickbook/test/templates.quickbook (original)
+++ trunk/tools/quickbook/test/templates.quickbook 2009-07-08 17:41:00 EDT (Wed, 08 Jul 2009)
@@ -100,4 +100,10 @@
 [template test[x] [join1 [join2 0 [x]]...0]]
 [test 0]
 
+[/-------------------------------- Mismatched template ]
+
+[template foo 1]
+[fool]
+
 [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