Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50207 - in trunk/tools/quickbook: . test
From: daniel_james_at_[hidden]
Date: 2008-12-08 16:51:57


Author: danieljames
Date: 2008-12-08 16:51:56 EST (Mon, 08 Dec 2008)
New Revision: 50207
URL: http://svn.boost.org/trac/boost/changeset/50207

Log:
Fail on a mismatched '' in the python and c++ syntax highlighters. And then ignore the rest of the code block to avoid further errors and warnings.
Added:
   trunk/tools/quickbook/test/fail-cpp-mismatched-escape.quickbook (props changed)
      - copied unchanged from r50204, /trunk/tools/quickbook/test/code-block-bad-escape-cpp.quickbook
   trunk/tools/quickbook/test/fail-python-mismatched-escape.quickbook (props changed)
      - copied unchanged from r50204, /trunk/tools/quickbook/test/code-block-bad-escape-python.quickbook
Removed:
   trunk/tools/quickbook/test/code-block-bad-escape-cpp.gold
   trunk/tools/quickbook/test/code-block-bad-escape-cpp.quickbook
   trunk/tools/quickbook/test/code-block-bad-escape-python.gold
   trunk/tools/quickbook/test/code-block-bad-escape-python.quickbook
Text files modified:
   trunk/tools/quickbook/syntax_highlight.hpp | 50 +++++++++++++++++++++++++--------------
   trunk/tools/quickbook/test/Jamfile.v2 | 4 +-
   2 files changed, 34 insertions(+), 20 deletions(-)

Modified: trunk/tools/quickbook/syntax_highlight.hpp
==============================================================================
--- trunk/tools/quickbook/syntax_highlight.hpp (original)
+++ trunk/tools/quickbook/syntax_highlight.hpp 2008-12-08 16:51:56 EST (Mon, 08 Dec 2008)
@@ -75,16 +75,23 @@
                     )
                     ;
 
- escape
- = (
- str_p("``")
- >> eps_p(+(anychar_p - "``") >> eps_p("``"))
- ) [PreEscape(self.escape_actions, save)]
- >> (
- (+(anychar_p - "``") >> eps_p("``"))
- & qbk_phrase
+ escape =
+ str_p("``") [PreEscape(self.escape_actions, save)]
+ >>
+ (
+ (
+ (
+ (+(anychar_p - "``") >> eps_p("``"))
+ & qbk_phrase
+ )
+ >> str_p("``")
                         )
- >> str_p("``") [PostEscape(self.out, self.escape_actions, save)]
+ |
+ (
+ eps_p [self.escape_actions.error]
+ >> *anychar_p
+ )
+ ) [PostEscape(self.out, self.escape_actions, save)]
                     ;
 
                 preprocessor
@@ -213,16 +220,23 @@
                     )
                     ;
 
- escape
- = (
- str_p("``")
- >> eps_p(+(anychar_p - "``") >> eps_p("``"))
- ) [PreEscape(self.escape_actions, save)]
- >> (
- (+(anychar_p - "``") >> eps_p("``"))
- & qbk_phrase
+ escape =
+ str_p("``") [PreEscape(self.escape_actions, save)]
+ >>
+ (
+ (
+ (
+ (+(anychar_p - "``") >> eps_p("``"))
+ & qbk_phrase
+ )
+ >> str_p("``")
+ )
+ |
+ (
+ eps_p [self.escape_actions.error]
+ >> *anychar_p
                         )
- >> str_p("``") [PostEscape(self.out, self.escape_actions, save)]
+ ) [PostEscape(self.out, self.escape_actions, save)]
                     ;
 
                 comment

Modified: trunk/tools/quickbook/test/Jamfile.v2
==============================================================================
--- trunk/tools/quickbook/test/Jamfile.v2 (original)
+++ trunk/tools/quickbook/test/Jamfile.v2 2008-12-08 16:51:56 EST (Mon, 08 Dec 2008)
@@ -14,8 +14,6 @@
     [ quickbook-test quickbook-manual ]
     [ quickbook-test code-block-1 ]
     [ quickbook-test code-block-2 ]
- [ quickbook-test code-block-bad-escape-cpp ]
- [ quickbook-test code-block-bad-escape-python ]
     [ quickbook-test code-snippet ]
     [ quickbook-test preformatted ]
     [ quickbook-test link-side-by-side ]
@@ -27,6 +25,8 @@
     [ quickbook-fail-test fail-import ]
     [ quickbook-fail-test fail-template-arguments1 ]
     [ quickbook-fail-test fail-template-arguments2 ]
+ [ quickbook-fail-test fail-cpp-mismatched-escape ]
+ [ quickbook-fail-test fail-python-mismatched-escape ]
     ;
 
 

Deleted: trunk/tools/quickbook/test/code-block-bad-escape-cpp.gold
==============================================================================
--- trunk/tools/quickbook/test/code-block-bad-escape-cpp.gold 2008-12-08 16:51:56 EST (Mon, 08 Dec 2008)
+++ (empty file)
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
-<article id="odd_code_markup__" name="Odd code markup. " dirname="odd_code_markup__"
-last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude">
- <articleinfo>
- </articleinfo>
- <title>Odd code markup. </title>
- <para>
- </para>
-
-<programlisting>## <phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase>
-</programlisting>
-</article>

Deleted: trunk/tools/quickbook/test/code-block-bad-escape-cpp.quickbook
==============================================================================
--- trunk/tools/quickbook/test/code-block-bad-escape-cpp.quickbook 2008-12-08 16:51:56 EST (Mon, 08 Dec 2008)
+++ (empty file)
@@ -1,5 +0,0 @@
-[article Odd code markup. [quickbook 1.4] ]
-
-[c++]
-
- `` int main() {}

Deleted: trunk/tools/quickbook/test/code-block-bad-escape-python.gold
==============================================================================
--- trunk/tools/quickbook/test/code-block-bad-escape-python.gold 2008-12-08 16:51:56 EST (Mon, 08 Dec 2008)
+++ (empty file)
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
-<article id="odd_code_markup__" name="Odd code markup. " dirname="odd_code_markup__"
-last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude">
- <articleinfo>
- </articleinfo>
- <title>Odd code markup. </title>
- <para>
- </para>
-
-<programlisting><phrase role="keyword">print</phrase> <phrase role="string">&quot;Hello World.&quot;</phrase> ##
-</programlisting>
-</article>

Deleted: trunk/tools/quickbook/test/code-block-bad-escape-python.quickbook
==============================================================================
--- trunk/tools/quickbook/test/code-block-bad-escape-python.quickbook 2008-12-08 16:51:56 EST (Mon, 08 Dec 2008)
+++ (empty file)
@@ -1,5 +0,0 @@
-[article Odd code markup. [quickbook 1.4] ]
-
-[python]
-
- print "Hello World." ``


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