From f7d1468cc0fe4237b702252f9bbaae5ba61b6bfd Mon Sep 17 00:00:00 2001 From: GrĂ©goire DuchĂȘne Date: Sun, 5 Dec 2010 00:45:11 +0100 Subject: Bug inside the inline code text rule fixed. It turned out that the inline code text rule was not honoring the verbatim constraint either. This issue is now solved. Also, I made the text_p parser more flexible by adding an inherited attribute to it. --- src/parser/text_p.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/parser/text_p.cpp') diff --git a/src/parser/text_p.cpp b/src/parser/text_p.cpp index 22e2a12..46dd37b 100644 --- a/src/parser/text_p.cpp +++ b/src/parser/text_p.cpp @@ -17,18 +17,19 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. text_p::text_p() : text_p::base_type(text_) { using namespace qi; + using namespace ph; using qi::standard_wide::char_; - text_ = stext_ | ptext_; + text_ = stext_(_r1) | ptext_(_r1); - stext_ = lit("***") >> attr(VSEMPH) >> +text_ >> "***" - | lit("**") >> attr(SEMPH) >> +text_ >> "**" - | lit('*') >> attr(EMPH) >> +text_ >> '*' - | lit("''") >> attr(SALT) >> +text_ >> "''" - | lit('\'') >> attr(ALT) >> +text_ >> '\'' - | lit('`') >> attr(CODE) >> +ptext_ >> '`'; + stext_ = lit("***") >> attr(VSEMPH) >> +text_(val(L"*'`")) >> "***" + | lit("**") >> attr(SEMPH) >> +text_(val(L"*'`")) >> "**" + | lit('*') >> attr(EMPH) >> +text_(val(L"*'`")) >> '*' + | lit("''") >> attr(SALT) >> +text_(val(L"*'`"))>> "''" + | lit('\'') >> attr(ALT) >> +text_(val(L"*'`")) >> '\'' + | lit('`') >> attr(CODE) >> +ptext_(val(L"`")) >> '`'; - ptext_ = +(echar_ | rchar_); + ptext_ = +(echar_ | rchar_(_r1)); echar_ = lit('\\') >> char_; - rchar_ = char_ - char_(L"*'`"); + rchar_ = char_ - char_(_r1); } -- cgit v1.2.3-70-g09d2