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.

[SVN r50207]
This commit is contained in:
Daniel James 2008-12-08 21:51:56 +00:00
parent f677418c29
commit a6b8f8aac4
6 changed files with 34 additions and 46 deletions

View File

@ -75,16 +75,23 @@ namespace quickbook
)
;
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 @@ namespace quickbook
)
;
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)]
;
comment

View File

@ -14,8 +14,6 @@ test-suite quickbook.test :
[ 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 @@ test-suite quickbook.test :
[ 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 ]
;

View 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>

View 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>