Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68880 - in branches/quickbook-filenames/tools/quickbook: src test/doc-info
From: dnljms_at_[hidden]
Date: 2011-02-14 19:18:48


Author: danieljames
Date: 2011-02-14 19:18:45 EST (Mon, 14 Feb 2011)
New Revision: 68880
URL: http://svn.boost.org/trac/boost/changeset/68880

Log:
Save source mode when including file in 1.6
Added:
   branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.4.gold (contents, props changed)
   branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.4.quickbook (contents, props changed)
   branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.5.gold (contents, props changed)
   branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.5.quickbook (contents, props changed)
   branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.6.gold (contents, props changed)
   branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.6.quickbook (contents, props changed)
   branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-cpp-include.quickbook (contents, props changed)
   branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-python-include.quickbook (contents, props changed)
   branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-teletype-include.quickbook (contents, props changed)
Text files modified:
   branches/quickbook-filenames/tools/quickbook/src/actions.cpp | 7 +++++--
   branches/quickbook-filenames/tools/quickbook/test/doc-info/Jamfile.v2 | 3 +++
   2 files changed, 8 insertions(+), 2 deletions(-)

Modified: branches/quickbook-filenames/tools/quickbook/src/actions.cpp
==============================================================================
--- branches/quickbook-filenames/tools/quickbook/src/actions.cpp (original)
+++ branches/quickbook-filenames/tools/quickbook/src/actions.cpp 2011-02-14 19:18:45 EST (Mon, 14 Feb 2011)
@@ -1446,7 +1446,7 @@
         // swap the filenames
         std::swap(actions.filename, filein);
 
- // save the doc info strings
+ // save the doc info strings and source mode
         if(qbk_version_n >= 106) {
             doc_type = actions.doc_type;
             doc_id = actions.doc_id;
@@ -1460,7 +1460,8 @@
             actions.doc_last_revision.swap(doc_last_revision);
         }
         
- // save the version info
+ // save the source mode and version info (only restored for 1.6+)
+ std::string source_mode = actions.source_mode;
         unsigned qbk_major_version_store = qbk_major_version;
         unsigned qbk_minor_version_store = qbk_minor_version;
         unsigned qbk_version_n_store = qbk_version_n;
@@ -1496,6 +1497,8 @@
         
         if(qbk_version_n >= 106 || qbk_version_n_store >= 106)
         {
+ actions.source_mode = source_mode;
+
             qbk_major_version = qbk_major_version_store;
             qbk_minor_version = qbk_minor_version_store;
             qbk_version_n = qbk_version_n_store;

Modified: branches/quickbook-filenames/tools/quickbook/test/doc-info/Jamfile.v2
==============================================================================
--- branches/quickbook-filenames/tools/quickbook/test/doc-info/Jamfile.v2 (original)
+++ branches/quickbook-filenames/tools/quickbook/test/doc-info/Jamfile.v2 2011-02-14 19:18:45 EST (Mon, 14 Feb 2011)
@@ -18,4 +18,7 @@
     [ quickbook-test empty-attributes ]
     [ quickbook-test duplicates-1.1 ]
     [ quickbook-test duplicates-1.5 ]
+ [ quickbook-test source-mode-1.4 ]
+ [ quickbook-test source-mode-1.5 ]
+ [ quickbook-test source-mode-1.6 ]
     ;

Added: branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.4.gold
==============================================================================
--- (empty file)
+++ branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.4.gold 2011-02-14 19:18:45 EST (Mon, 14 Feb 2011)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
+<article id="c___test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <title>C++ test</title>
+ <articleinfo>
+ <legalnotice>
+ <para>
+ <code><phrase role="keyword">def</phrase> <phrase role="identifier">foo</phrase><phrase
+ role="special">(</phrase><phrase role="identifier">x</phrase><phrase role="special">):</phrase>
+ <phrase role="keyword">print</phrase> <phrase role="string">&quot;Hello&quot;</phrase></code>
+ </para>
+ </legalnotice>
+ <articlepurpose>
+ <code><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase
+ role="special">()</phrase> <phrase role="special">{}</phrase></code>
+ </articlepurpose>
+ </articleinfo>
+ <para>
+
+<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting>
+ </para>
+ <para>
+
+<programlisting><phrase role="keyword">def</phrase> <phrase role="identifier">foo</phrase><phrase role="special">():</phrase></programlisting>
+ </para>
+ <para>
+
+<programlisting><phrase role="keyword">def</phrase> <phrase role="identifier">foo</phrase><phrase role="special">(</phrase><phrase role="identifier">x</phrase><phrase role="special">):</phrase></programlisting>
+ </para>
+ <para>
+
+<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting>
+ </para>
+ <para>
+
+<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting>
+ </para>
+</article>

Added: branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.4.quickbook
==============================================================================
--- (empty file)
+++ branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.4.quickbook 2011-02-14 19:18:45 EST (Mon, 14 Feb 2011)
@@ -0,0 +1,17 @@
+[article C++ test
+[quickbook 1.5]
+[source-mode python]
+[license `def foo(x): print "Hello"`]
+[source-mode c++]
+[purpose `int main() {}`]
+]
+
+```int main() {}```
+
+[include source-mode-python-include.quickbook]
+
+```def foo(x):```
+
+[include source-mode-cpp-include.quickbook]
+
+```int main() {}```

Added: branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.5.gold
==============================================================================
--- (empty file)
+++ branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.5.gold 2011-02-14 19:18:45 EST (Mon, 14 Feb 2011)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
+<article id="c___test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <title>C++ test</title>
+ <articleinfo>
+ <legalnotice>
+ <para>
+ <code><phrase role="keyword">def</phrase> <phrase role="identifier">foo</phrase><phrase
+ role="special">(</phrase><phrase role="identifier">x</phrase><phrase role="special">):</phrase>
+ <phrase role="keyword">print</phrase> <phrase role="string">&quot;Hello&quot;</phrase></code>
+ </para>
+ </legalnotice>
+ <articlepurpose>
+ <code>This shouldn't be highlighted</code>
+ </articlepurpose>
+ </articleinfo>
+ <para>
+
+<programlisting>This shouldn't be highlighted.</programlisting>
+ </para>
+ <para>
+
+<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting>
+ </para>
+ <para>
+
+<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting>
+ </para>
+ <para>
+
+<programlisting><phrase role="keyword">def</phrase> <phrase role="identifier">foo</phrase><phrase role="special">():</phrase></programlisting>
+ </para>
+ <para>
+
+<programlisting><phrase role="keyword">def</phrase> <phrase role="identifier">foo</phrase><phrase role="special">(</phrase><phrase role="identifier">x</phrase><phrase role="special">):</phrase></programlisting>
+ </para>
+ <para>
+
+<programlisting>This shouldn't be highlighted</programlisting>
+ </para>
+ <para>
+
+<programlisting>This shouldn't be highlighted.</programlisting>
+ </para>
+</article>

Added: branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.5.quickbook
==============================================================================
--- (empty file)
+++ branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.5.quickbook 2011-02-14 19:18:45 EST (Mon, 14 Feb 2011)
@@ -0,0 +1,21 @@
+[article C++ test
+[quickbook 1.5]
+[source-mode python]
+[license `def foo(x): print "Hello"`]
+[source-mode teletype]
+[purpose `This shouldn't be highlighted`]
+]
+
+```This shouldn't be highlighted.```
+
+[include source-mode-cpp-include.quickbook]
+
+```int main() {}```
+
+[include source-mode-python-include.quickbook]
+
+```def foo(x):```
+
+[include source-mode-teletype-include.quickbook]
+
+```This shouldn't be highlighted.```

Added: branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.6.gold
==============================================================================
--- (empty file)
+++ branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.6.gold 2011-02-14 19:18:45 EST (Mon, 14 Feb 2011)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
+<article id="c___test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <title>C++ test</title>
+ <articleinfo>
+ <legalnotice>
+ <para>
+ <code><phrase role="keyword">def</phrase> <phrase role="identifier">foo</phrase><phrase
+ role="special">(</phrase><phrase role="identifier">x</phrase><phrase role="special">):</phrase>
+ <phrase role="keyword">print</phrase> <phrase role="string">&quot;Hello&quot;</phrase></code>
+ </para>
+ </legalnotice>
+ <articlepurpose>
+ <code>This shouldn't be highlighted</code>
+ </articlepurpose>
+ </articleinfo>
+ <para>
+
+<programlisting>This shouldn't be highlighted.</programlisting>
+ </para>
+ <para>
+
+<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase></programlisting>
+ </para>
+ <para>
+
+<programlisting>This shouldn't be highlighted.</programlisting>
+ </para>
+ <para>
+
+<programlisting><phrase role="keyword">def</phrase> <phrase role="identifier">foo</phrase><phrase role="special">():</phrase></programlisting>
+ </para>
+ <para>
+
+<programlisting>This shouldn't be highlighted.</programlisting>
+ </para>
+ <para>
+
+<programlisting>This shouldn't be highlighted</programlisting>
+ </para>
+ <para>
+
+<programlisting>This shouldn't be highlighted.</programlisting>
+ </para>
+</article>

Added: branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.6.quickbook
==============================================================================
--- (empty file)
+++ branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-1.6.quickbook 2011-02-14 19:18:45 EST (Mon, 14 Feb 2011)
@@ -0,0 +1,21 @@
+[article C++ test
+[quickbook 1.6]
+[source-mode python]
+[license `def foo(x): print "Hello"`]
+[source-mode teletype]
+[purpose `This shouldn't be highlighted`]
+]
+
+```This shouldn't be highlighted.```
+
+[include source-mode-cpp-include.quickbook]
+
+```This shouldn't be highlighted.```
+
+[include source-mode-python-include.quickbook]
+
+```This shouldn't be highlighted.```
+
+[include source-mode-teletype-include.quickbook]
+
+```This shouldn't be highlighted.```

Added: branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-cpp-include.quickbook
==============================================================================
--- (empty file)
+++ branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-cpp-include.quickbook 2011-02-14 19:18:45 EST (Mon, 14 Feb 2011)
@@ -0,0 +1,5 @@
+[article C++ source mode include
+[source-mode c++]
+]
+
+```int main() {}```
\ No newline at end of file

Added: branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-python-include.quickbook
==============================================================================
--- (empty file)
+++ branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-python-include.quickbook 2011-02-14 19:18:45 EST (Mon, 14 Feb 2011)
@@ -0,0 +1,5 @@
+[article Python source mode include
+[source-mode python]
+]
+
+```def foo():```
\ No newline at end of file

Added: branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-teletype-include.quickbook
==============================================================================
--- (empty file)
+++ branches/quickbook-filenames/tools/quickbook/test/doc-info/source-mode-teletype-include.quickbook 2011-02-14 19:18:45 EST (Mon, 14 Feb 2011)
@@ -0,0 +1,5 @@
+[article Teletype source mode include
+[source-mode teletype]
+]
+
+```This shouldn't be highlighted```
\ 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