Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75839 - trunk/tools/quickbook/src
From: dnljms_at_[hidden]
Date: 2011-12-07 04:18:44


Author: danieljames
Date: 2011-12-07 04:18:43 EST (Wed, 07 Dec 2011)
New Revision: 75839
URL: http://svn.boost.org/trac/boost/changeset/75839

Log:
Quickbook: Tighter code block parser.

Not entirely sure about this. Maybe it should use a version switch.
Text files modified:
   trunk/tools/quickbook/src/main_grammar.cpp | 40 ++++++++++++++++++++++++----------------
   1 files changed, 24 insertions(+), 16 deletions(-)

Modified: trunk/tools/quickbook/src/main_grammar.cpp
==============================================================================
--- trunk/tools/quickbook/src/main_grammar.cpp (original)
+++ trunk/tools/quickbook/src/main_grammar.cpp 2011-12-07 04:18:43 EST (Wed, 07 Dec 2011)
@@ -565,23 +565,31 @@
             ;
 
         local.code_block =
- (
- "```" >> *(*cl::blank_p >> cl::eol_p) >>
- (
- *(cl::anychar_p - (*cl::space_p >> "```"))
- >> !(*cl::blank_p >> cl::eol_p)
- >> cl::eps_p(*cl::space_p >> "```")
- ) [actions.code_block]
- >> *cl::space_p >> "```"
+ "```"
+ >> ~cl::eps_p("`")
+ >> *(*cl::blank_p >> cl::eol_p)
+ >> ( *( "````" >> *cl::ch_p('`')
+ | ( cl::anychar_p
+ - (*cl::space_p >> "```" >> ~cl::eps_p("`"))
+ )
+ )
+ >> !(*cl::blank_p >> cl::eol_p)
+ ) [actions.code_block]
+ >> ( *cl::space_p >> "```"
+ | cl::eps_p [actions.error("Unfinished code block")]
                 )
- | (
- "``" >> *(*cl::blank_p >> cl::eol_p) >>
- (
- *(cl::anychar_p - (*cl::space_p >> "``"))
- >> !(*cl::blank_p >> cl::eol_p)
- >> cl::eps_p(*cl::space_p >> "``")
- ) [actions.code_block]
- >> *cl::space_p >> "``"
+ | "``"
+ >> ~cl::eps_p("`")
+ >> *(*cl::blank_p >> cl::eol_p)
+ >> ( *( "```" >> *cl::ch_p('`')
+ | ( cl::anychar_p
+ - (*cl::space_p >> "``" >> ~cl::eps_p("`"))
+ )
+ )
+ >> !(*cl::blank_p >> cl::eol_p)
+ ) [actions.code_block]
+ >> ( *cl::space_p >> "``"
+ | cl::eps_p [actions.error("Unfinished code block")]
                 )
             ;
 


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