diff options
Diffstat (limited to 'src/parser')
| -rw-r--r-- | src/parser/document_p.cpp | 2 | ||||
| -rw-r--r-- | src/parser/text_p.cpp | 5 | ||||
| -rw-r--r-- | src/parser/text_p.h | 1 |
3 files changed, 6 insertions, 2 deletions
diff --git a/src/parser/document_p.cpp b/src/parser/document_p.cpp index 208e1f1..5b45212 100644 --- a/src/parser/document_p.cpp +++ b/src/parser/document_p.cpp @@ -16,5 +16,5 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "document_p.h" document_p::document_p() : document_p::base_type(document_) { - document_ = +text_(ph::val(L"*'`$^@")); + document_ = +text_(ph::val(L"*'`$^@[")); } diff --git a/src/parser/text_p.cpp b/src/parser/text_p.cpp index 0701691..ce1e233 100644 --- a/src/parser/text_p.cpp +++ b/src/parser/text_p.cpp @@ -20,7 +20,7 @@ text_p::text_p() : text_p::base_type(text_) { using namespace ph; using qi::standard_wide::char_; - text_ = stext_(_r1) | ptext_(_r1); + text_ = stext_(_r1) | pstext_(_r1) | ptext_(_r1); stext_ = lit("***") >> attr(VSEMPH) >> +text_(_r1) >> "***" | lit("**") >> attr(SEMPH) >> +text_(_r1) >> "**" @@ -34,6 +34,9 @@ text_p::text_p() : text_p::base_type(text_) { | lit(L"@\"") >> attr(QUOTE) >> +text_(val(L"*'`$@\"")) >> '"' | lit(L"@_") >> attr(SUB) >> +text_(val(L"*'`$@_")) >> '_'; + pstext_ = lit('[') >> attr(LINK) >> +text_(val(L"]")) >> ']' >> + lit('(') >> ptext_(val(L")")) >> ')'; + ptext_ = +(echar_ | rchar_(_r1)); echar_ = lit('\\') >> char_; rchar_ = char_ - char_(_r1); diff --git a/src/parser/text_p.h b/src/parser/text_p.h index d9fe7a0..35fc41f 100644 --- a/src/parser/text_p.h +++ b/src/parser/text_p.h @@ -26,6 +26,7 @@ namespace ph = boost::phoenix; struct text_p : qi::grammar<iiterator, text_t(std::wstring)> { qi::rule<iiterator, text_t(std::wstring)> text_; qi::rule<iiterator, stext_t(std::wstring)> stext_; + qi::rule<iiterator, pstext_t(std::wstring)> pstext_; qi::rule<iiterator, std::wstring(std::wstring)> ptext_; qi::rule<iiterator, wchar_t()> echar_; qi::rule<iiterator, wchar_t(std::wstring)> rchar_; |
