mirror of
https://github.com/boostorg/quickbook.git
synced 2026-01-26 06:42:27 +00:00
Quickbook: Match macros in simple markup in the grammar.
[SVN r72392]
This commit is contained in:
@@ -380,14 +380,7 @@ namespace quickbook
|
||||
values.finish();
|
||||
|
||||
out << markup.pre;
|
||||
if (std::string const* ptr = find(macro, content.get_quickbook().c_str()))
|
||||
{
|
||||
out << *ptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
out << content.get_boostbook();
|
||||
}
|
||||
out << content.get_boostbook();
|
||||
out << markup.post;
|
||||
}
|
||||
|
||||
|
||||
@@ -124,16 +124,13 @@ namespace quickbook
|
||||
|
||||
simple_phrase_action(
|
||||
collector& out
|
||||
, string_symbols const& macro
|
||||
, quickbook::actions& actions)
|
||||
: out(out)
|
||||
, macro(macro)
|
||||
, actions(actions) {}
|
||||
|
||||
void operator()(char) const;
|
||||
|
||||
collector& out;
|
||||
string_symbols const& macro;
|
||||
quickbook::actions& actions;
|
||||
};
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace quickbook
|
||||
, raw_char(phrase, *this)
|
||||
, escape_unicode(phrase, *this)
|
||||
|
||||
, simple_markup(phrase, macro, *this)
|
||||
, simple_markup(phrase, *this)
|
||||
|
||||
, break_(phrase, *this)
|
||||
, do_macro(phrase, *this)
|
||||
|
||||
@@ -368,10 +368,10 @@ namespace quickbook
|
||||
;
|
||||
|
||||
local.simple_markup =
|
||||
cl::chset<>("*/_=") [local.simple_markup.mark = ph::arg1]
|
||||
>> cl::eps_p(cl::graph_p) // graph_p must follow first mark
|
||||
cl::chset<>("*/_=") [local.simple_markup.mark = ph::arg1]
|
||||
>> cl::eps_p(cl::graph_p) // graph_p must follow first mark
|
||||
>> lookback
|
||||
[ cl::anychar_p
|
||||
[ cl::anychar_p // skip back over the markup
|
||||
>> ~cl::eps_p(cl::f_ch_p(local.simple_markup.mark))
|
||||
// first mark not be preceeded by
|
||||
// the same character.
|
||||
@@ -384,11 +384,12 @@ namespace quickbook
|
||||
[
|
||||
actions.scoped_output()
|
||||
[
|
||||
(+( ~cl::eps_p(local.simple_markup_end)
|
||||
>> local.nested_char
|
||||
)) [actions.docinfo_value(ph::arg1, ph::arg2)]
|
||||
]
|
||||
>> cl::f_ch_p(local.simple_markup.mark)
|
||||
( cl::eps_p(actions.macro >> local.simple_markup_end)
|
||||
>> actions.macro [actions.do_macro]
|
||||
| +(~cl::eps_p(local.simple_markup_end) >> local.nested_char)
|
||||
) [actions.docinfo_value(ph::arg1, ph::arg2)]
|
||||
]
|
||||
>> cl::f_ch_p(local.simple_markup.mark)
|
||||
[actions.simple_markup]
|
||||
]
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user